diff mbox series

spi: Provide defer reason if getting irq during probe fails

Message ID 20241004094234.268301-2-u.kleine-koenig@baylibre.com (mailing list archive)
State Accepted
Commit eb6c65049a274c37f9b6fdf632843b609a0b8fa8
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

Comments

Mark Brown Oct. 5, 2024, 12:28 a.m. UTC | #1
On Fri, 04 Oct 2024 11:42:32 +0200, Uwe Kleine-König wrote:
> 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...
> 
> [...]

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next

Thanks!

[1/1] spi: Provide defer reason if getting irq during probe fails
      commit: eb6c65049a274c37f9b6fdf632843b609a0b8fa8

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark
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;
 	}