netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1] net: fec: Don't fail on missing optional phy-reset-gpios
@ 2023-02-03 13:21 Alexander Stein
  2023-02-07  6:30 ` Jakub Kicinski
  0 siblings, 1 reply; 3+ messages in thread
From: Alexander Stein @ 2023-02-03 13:21 UTC (permalink / raw)
  To: Wei Fang, Shenwei Wang, Clark Wang, David S . Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Arnd Bergmann,
	Andrew Lunn
  Cc: Alexander Stein, NXP Linux Team, netdev

The conversion to gpio descriptors accidentally removed the short return
if there is no 'phy-reset-gpios' property, leading to the error

fec 30be0000.ethernet: error -ENOENT: failed to get phy-reset-gpios

This is especially the case when the PHY reset GPIO is specified in
the PHY node itself.

Fixes: 468ba54bd616 ("fec: convert to gpio descriptor")
Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com>
---
 drivers/net/ethernet/freescale/fec_main.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c
index 2716898e0b9b..1fddd7ec1118 100644
--- a/drivers/net/ethernet/freescale/fec_main.c
+++ b/drivers/net/ethernet/freescale/fec_main.c
@@ -4058,6 +4058,8 @@ static int fec_reset_phy(struct platform_device *pdev)
 
 	phy_reset = devm_gpiod_get(&pdev->dev, "phy-reset",
 			active_high ? GPIOD_OUT_HIGH : GPIOD_OUT_LOW);
+	if (PTR_ERR(phy_reset) == -ENOENT)
+		return 0;
 	if (IS_ERR(phy_reset))
 		return dev_err_probe(&pdev->dev, PTR_ERR(phy_reset),
 				     "failed to get phy-reset-gpios\n");
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-02-07 13:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-02-03 13:21 [PATCH 1/1] net: fec: Don't fail on missing optional phy-reset-gpios Alexander Stein
2023-02-07  6:30 ` Jakub Kicinski
2023-02-07 13:24   ` Alexander Stein

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).