Commit d38dc01a authored by Conor Dooley's avatar Conor Dooley Committed by Mark Brown

spi: microchip-core: fix potentially incorrect return from probe

If platform_get_irqi() returns 0, the error case will be triggered but
probe() will return 0 rather than an error. Ape the other drivers using
this pattern and return -ENXIO.
Reported-by: default avatarYang Li <yang.lee@linux.alibaba.com>
Link: https://lore.kernel.org/linux-spi/20220609055533.95866-2-yang.lee@linux.alibaba.com/Signed-off-by: default avatarConor Dooley <conor.dooley@microchip.com>
Fixes: 9ac8d176 ("spi: add support for microchip fpga spi controllers")
Link: https://lore.kernel.org/r/20220614065809.1969177-1-conor.dooley@microchip.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 35f2b9af
...@@ -541,7 +541,7 @@ static int mchp_corespi_probe(struct platform_device *pdev) ...@@ -541,7 +541,7 @@ static int mchp_corespi_probe(struct platform_device *pdev)
spi->irq = platform_get_irq(pdev, 0); spi->irq = platform_get_irq(pdev, 0);
if (spi->irq <= 0) { if (spi->irq <= 0) {
dev_err(&pdev->dev, "invalid IRQ %d for SPI controller\n", spi->irq); dev_err(&pdev->dev, "invalid IRQ %d for SPI controller\n", spi->irq);
ret = spi->irq; ret = -ENXIO;
goto error_release_master; goto error_release_master;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment