net: phy: phylink: Release link GPIO
authorFlorian Fainelli <f.fainelli@gmail.com>
Thu, 10 May 2018 20:17:30 +0000 (13:17 -0700)
committerDavid S. Miller <davem@davemloft.net>
Fri, 11 May 2018 16:03:05 +0000 (12:03 -0400)
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>
drivers/net/phy/phylink.c

index 412d1cf4fa6631505efe99072ff6c0c0fc4425fa..6392b5248cf547fb05eb31e4c377fab83878246d 100644 (file)
@@ -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);