diff options
author | Lars-Peter Clausen <lars@metafoo.de> | 2016-07-15 11:04:18 +0200 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2016-07-15 11:44:59 +0100 |
commit | 4db9bf548bb00d84ba7dfd70f124de16386c0c55 (patch) | |
tree | 01730038753a3dbdf5ccaaaf55159b543bb2a0dd /drivers/spi/spi-xilinx.c | |
parent | 1a695a905c18548062509178b98bc91e67510864 (diff) | |
download | linux-stable-4db9bf548bb00d84ba7dfd70f124de16386c0c55.tar.gz linux-stable-4db9bf548bb00d84ba7dfd70f124de16386c0c55.tar.bz2 linux-stable-4db9bf548bb00d84ba7dfd70f124de16386c0c55.zip |
spi: xilinx: Handle errors from platform_get_irq()
The Xilinx SPI driver can operate without an IRQ, but not every error
returned by platform_get_irq() means that no IRQ was specified. It will
also return an error if the IRQ specification is invalid or the IRQ
provider is not yet available (EPROBE_DEFER).
So instead of ignoring all errors only ignore ENXIO, which means no IRQ was
specified, and propagate all other errors to device driver core.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/spi/spi-xilinx.c')
-rw-r--r-- | drivers/spi/spi-xilinx.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/spi/spi-xilinx.c b/drivers/spi/spi-xilinx.c index 3009121173cd..e62eb9ace825 100644 --- a/drivers/spi/spi-xilinx.c +++ b/drivers/spi/spi-xilinx.c @@ -455,7 +455,10 @@ static int xilinx_spi_probe(struct platform_device *pdev) xspi->buffer_size = xilinx_spi_find_buffer_size(xspi); xspi->irq = platform_get_irq(pdev, 0); - if (xspi->irq >= 0) { + if (xspi->irq < 0 && xspi->irq != -ENXIO) { + ret = xspi->irq; + goto put_master; + } else if (xspi->irq >= 0) { /* Register for SPI Interrupt */ ret = devm_request_irq(&pdev->dev, xspi->irq, xilinx_spi_irq, 0, dev_name(&pdev->dev), xspi); |