mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH net-next] smsc911x: propagate reset GPIO errors
@ 2026-10-07 10:47 phucduc.bui
  2026-10-09 10:48 ` netdev-bot+sashiko
  0 siblings, 1 reply; 2+ messages in thread
From: phucduc.bui @ 2026-10-07 10:47 UTC (permalink / raw)
  To: Steve Glendinning, Andrew Lunn, davem, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, netdev, linux-kernel
  Cc: bui duc phuc

From: bui duc phuc <phucduc.bui@gmail.com>

devm_gpiod_get_optional() may return -EPROBE_DEFER or other errors,
but smsc911x_request_resources() currently does not handle them.

Check the return value and propagate errors from the reset GPIO lookup.
Release the regulators if they were successfully acquired before the
GPIO lookup failed.

Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
---
 drivers/net/ethernet/smsc/smsc911x.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/net/ethernet/smsc/smsc911x.c b/drivers/net/ethernet/smsc/smsc911x.c
index 3ebd0664c697..41423baaf0af 100644
--- a/drivers/net/ethernet/smsc/smsc911x.c
+++ b/drivers/net/ethernet/smsc/smsc911x.c
@@ -439,6 +439,13 @@ static int smsc911x_request_resources(struct platform_device *pdev)
 	pdata->reset_gpiod = devm_gpiod_get_optional(&pdev->dev,
 						     "reset",
 						     GPIOD_OUT_LOW);
+	if (IS_ERR(pdata->reset_gpiod)) {
+		if (!ret)
+			regulator_bulk_free(ARRAY_SIZE(pdata->supplies),
+					    pdata->supplies);
+		return dev_err_probe(&pdev->dev, PTR_ERR(pdata->reset_gpiod),
+				     "failed to get reset gpio\n");
+	}
 
 	/* Request clock */
 	pdata->clk = clk_get(&pdev->dev, NULL);
-- 
2.43.0


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

end of thread, other threads:[~2026-10-09 10:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-07 10:47 [PATCH net-next] smsc911x: propagate reset GPIO errors phucduc.bui
2026-10-09 10:48 ` netdev-bot+sashiko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®