Skip to content

Commit 345fef7

Browse files
GustavoARSilvabroonie
authored andcommitted
spi: spi-sh: fix error return code in spi_sh_probe()
platform_get_irq() returns an error code, but the spi-sh driver ignores it and always returns -ENODEV. This is not correct and, prevents -EPROBE_DEFER from being propagated properly. Print and propagate the return value of platform_get_irq on failure. This issue was detected with the help of Coccinelle. Signed-off-by: Gustavo A. R. Silva <[email protected]> Signed-off-by: Mark Brown <[email protected]>
1 parent 5771a8c commit 345fef7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/spi/spi-sh.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -446,8 +446,8 @@ static int spi_sh_probe(struct platform_device *pdev)
446446

447447
irq = platform_get_irq(pdev, 0);
448448
if (irq < 0) {
449-
dev_err(&pdev->dev, "platform_get_irq error\n");
450-
return -ENODEV;
449+
dev_err(&pdev->dev, "platform_get_irq error: %d\n", irq);
450+
return irq;
451451
}
452452

453453
master = spi_alloc_master(&pdev->dev, sizeof(struct spi_sh_data));

0 commit comments

Comments
 (0)