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

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.com


Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 35f2b9af
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -541,7 +541,7 @@ static int mchp_corespi_probe(struct platform_device *pdev)
	spi->irq = platform_get_irq(pdev, 0);
	if (spi->irq <= 0) {
		dev_err(&pdev->dev, "invalid IRQ %d for SPI controller\n", spi->irq);
		ret = spi->irq;
		ret = -ENXIO;
		goto error_release_master;
	}