From mboxrd@z Thu Jan 1 00:00:00 1970 From: Florian Fainelli Subject: [PATCH net-next 2/9] net: phy: phylink: Release link GPIO Date: Sat, 5 May 2018 12:04:18 -0700 Message-ID: <20180505190425.14378-3-f.fainelli@gmail.com> References: <20180505190425.14378-1-f.fainelli@gmail.com> Cc: Florian Fainelli , privat@egil-hjelmeland.no, andrew@lunn.ch, vivien.didelot@savoirfairelinux.com, davem@davemloft.net, rmk+kernel@armlinux.org.uk, sean.wang@mediatek.com, Woojung.Huh@microchip.com, john@phrozen.org, cphealy@gmail.com To: netdev@vger.kernel.org Return-path: Received: from mail-ot0-f196.google.com ([74.125.82.196]:40850 "EHLO mail-ot0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751947AbeEETEh (ORCPT ); Sat, 5 May 2018 15:04:37 -0400 Received: by mail-ot0-f196.google.com with SMTP id n1-v6so28013011otf.7 for ; Sat, 05 May 2018 12:04:37 -0700 (PDT) In-Reply-To: <20180505190425.14378-1-f.fainelli@gmail.com> Sender: netdev-owner@vger.kernel.org List-ID: 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 --- drivers/net/phy/phylink.c | 2 ++ 1 file changed, 2 insertions(+) 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); -- 2.17.0