diff mbox series

spi: Provide defer reason if getting irq during probe fails

Message ID 20241004094234.268301-2-u.kleine-koenig@baylibre.com
State New
Headers show
Series spi: Provide defer reason if getting irq during probe fails | expand

Commit Message

Uwe Kleine-König Oct. 4, 2024, 9:42 a.m. UTC
From: Uwe Kleine-König <ukleinek@kernel.org>

Using dev_err_probe() in spi_probe() improves the kernel output from

	spi spi0.0: deferred probe pending: (reason unknown)

to

	spi spi0.0: deferred probe pending: ad7124: Failed to get irq...

for my current quest to make a certain spi device work.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
---
Hello,

I didn't check how dev_pm_domain_attach() behaves. Depending on that replacing
its error path by

	return dev_err_probe(dev, ret, "Failed to attach PM domain\n");

might be beneficial in a similar situation.

Best regards
Uwe

 drivers/spi/spi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


base-commit: 9852d85ec9d492ebef56dc5f229416c925758edc
diff mbox series

Patch

diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
index c1dad30a4528..dba202f8a525 100644
--- a/drivers/spi/spi.c
+++ b/drivers/spi/spi.c
@@ -419,7 +419,7 @@  static int spi_probe(struct device *dev)
 	if (dev->of_node) {
 		spi->irq = of_irq_get(dev->of_node, 0);
 		if (spi->irq == -EPROBE_DEFER)
-			return -EPROBE_DEFER;
+			return dev_err_probe(dev, -EPROBE_DEFER, "Failed to get irq\n");
 		if (spi->irq < 0)
 			spi->irq = 0;
 	}