diff options
author | Miquel Raynal <miquel.raynal@bootlin.com> | 2019-01-08 17:31:18 +0100 |
---|---|---|
committer | Kishon Vijay Abraham I <kishon@ti.com> | 2019-02-07 06:40:46 +0100 |
commit | ae4c5d69acc012ba40680cf8b63a2845622cc7c7 (patch) | |
tree | 398b2567579a1822355343c950cd97a1873a5a75 /drivers/phy/marvell | |
parent | phy: armada375-usb2: switch to SPDX license identifier (diff) | |
download | linux-ae4c5d69acc012ba40680cf8b63a2845622cc7c7.tar.xz linux-ae4c5d69acc012ba40680cf8b63a2845622cc7c7.zip |
phy: mvebu-cp110-comphy: fix port check in ->xlate()
So far the PHY ->xlate() callback was checking if the port was
"invalid" before continuing, meaning that the port has not been used
yet. This check is not correct as there is no opposite call to
->xlate() once the PHY is released by the user and the port will
remain "valid" after the first phy_get()/phy_put() calls. Hence, if
this driver is built as a module, inserted, removed and inserted
again, the PHY will appear busy and the second probe will fail.
To fix this, just drop the faulty check and instead verify that the
port number is valid (ie. in the possible range).
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Diffstat (limited to 'drivers/phy/marvell')
-rw-r--r-- | drivers/phy/marvell/phy-mvebu-cp110-comphy.c | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/drivers/phy/marvell/phy-mvebu-cp110-comphy.c b/drivers/phy/marvell/phy-mvebu-cp110-comphy.c index 187cccde53b5..d98e0451f6a1 100644 --- a/drivers/phy/marvell/phy-mvebu-cp110-comphy.c +++ b/drivers/phy/marvell/phy-mvebu-cp110-comphy.c @@ -580,8 +580,6 @@ static struct phy *mvebu_comphy_xlate(struct device *dev, return phy; lane = phy_get_drvdata(phy); - if (lane->port >= 0) - return ERR_PTR(-EBUSY); lane->port = args->args[0]; return phy; |