[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230306183115.87314-3-andriy.shevchenko@linux.intel.com>
Date: Mon, 6 Mar 2023 20:31:12 +0200
From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To: linux-spi@...r.kernel.org, linux-kernel@...r.kernel.org
Cc: Mark Brown <broonie@...nel.org>, Rob Herring <robh@...nel.org>,
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Subject: [PATCH v1 2/5] spi: mpc5xxx-psc: Return immediately if IRQ resource is unavailable
Return immediately if IRQ resource is unavailable. This will also
propagate the correct error code in such cases.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
---
drivers/spi/spi-mpc512x-psc.c | 3 +++
drivers/spi/spi-mpc52xx-psc.c | 3 +++
2 files changed, 6 insertions(+)
diff --git a/drivers/spi/spi-mpc512x-psc.c b/drivers/spi/spi-mpc512x-psc.c
index a2ea24a63cb4..8a436d1906eb 100644
--- a/drivers/spi/spi-mpc512x-psc.c
+++ b/drivers/spi/spi-mpc512x-psc.c
@@ -490,6 +490,9 @@ static int mpc512x_psc_spi_of_probe(struct platform_device *pdev)
(struct mpc512x_psc_fifo *)(tempp + sizeof(struct mpc52xx_psc));
mps->irq = platform_get_irq(pdev, 0);
+ if (mps->irq < 0)
+ return mps->irq;
+
ret = devm_request_irq(dev, mps->irq, mpc512x_psc_spi_isr, IRQF_SHARED,
"mpc512x-psc-spi", mps);
if (ret)
diff --git a/drivers/spi/spi-mpc52xx-psc.c b/drivers/spi/spi-mpc52xx-psc.c
index 1bf728f4d766..b75bc2457883 100644
--- a/drivers/spi/spi-mpc52xx-psc.c
+++ b/drivers/spi/spi-mpc52xx-psc.c
@@ -328,6 +328,9 @@ static int mpc52xx_psc_spi_of_probe(struct platform_device *pdev)
mps->fifo = ((void __iomem *)mps->psc) + sizeof(struct mpc52xx_psc);
mps->irq = platform_get_irq(pdev, 0);
+ if (mps->irq < 0)
+ return mps->irq;
+
ret = devm_request_irq(dev, mps->irq, mpc52xx_psc_spi_isr, 0,
"mpc52xx-psc-spi", mps);
if (ret)
--
2.39.1
Powered by blists - more mailing lists