diff options
| author | Conor Dooley <[email protected]> | 2022-06-14 06:58:10 +0000 |
|---|---|---|
| committer | Mark Brown <[email protected]> | 2022-06-14 08:26:41 +0000 |
| commit | d38dc01a4e68133e11ae74af7585d2c4bbd5803d (patch) | |
| tree | c3048a57f8ab05a5c9df0769fd034fdd26670002 /drivers/spi/spi-microchip-core.c | |
| parent | spi: tegra quad: Add Tegra Grace features (diff) | |
| download | kernel-d38dc01a4e68133e11ae74af7585d2c4bbd5803d.tar.gz kernel-d38dc01a4e68133e11ae74af7585d2c4bbd5803d.zip | |
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: Yang Li <[email protected]>
Link: https://lore.kernel.org/linux-spi/[email protected]/
Signed-off-by: Conor Dooley <[email protected]>
Fixes: 9ac8d17694b6 ("spi: add support for microchip fpga spi controllers")
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
Diffstat (limited to 'drivers/spi/spi-microchip-core.c')
| -rw-r--r-- | drivers/spi/spi-microchip-core.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/spi/spi-microchip-core.c b/drivers/spi/spi-microchip-core.c index 5b22a1395554..856a68fd8e9f 100644 --- a/drivers/spi/spi-microchip-core.c +++ b/drivers/spi/spi-microchip-core.c @@ -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; } |
