aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/phy/phylink.c
diff options
context:
space:
mode:
authorFlorian Fainelli <f.fainelli@gmail.com>2018-05-10 13:17:30 -0700
committerDavid S. Miller <davem@davemloft.net>2018-05-11 12:03:05 -0400
commitdaab3349ad1a69663ccad278ed71d55974d104b4 (patch)
tree22f316ea48ecc58fc63732f7de00e9cff6566d56 /drivers/net/phy/phylink.c
parentnet: phy: phylink: Use gpiod_get_value_cansleep() (diff)
downloadlinux-dev-daab3349ad1a69663ccad278ed71d55974d104b4.tar.xz
linux-dev-daab3349ad1a69663ccad278ed71d55974d104b4.zip
net: phy: phylink: Release link GPIO
We are not releasing the link GPIO descriptor with gpiod_put() which results in subsequent probing to get -EBUSY when calling fwnode_get_named_gpiod(). Fix this by doing the release in phylink_destroy(). Fixes: 9525ae83959b ("phylink: add phylink infrastructure") Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/phy/phylink.c')
-rw-r--r--drivers/net/phy/phylink.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/net/phy/phylink.c b/drivers/net/phy/phylink.c
index 412d1cf4fa66..6392b5248cf5 100644
--- a/drivers/net/phy/phylink.c
+++ b/drivers/net/phy/phylink.c
@@ -612,6 +612,8 @@ void phylink_destroy(struct phylink *pl)
{
if (pl->sfp_bus)
sfp_unregister_upstream(pl->sfp_bus);
+ if (!IS_ERR(pl->link_gpio))
+ gpiod_put(pl->link_gpio);
cancel_work_sync(&pl->resolve);
kfree(pl);