linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Mark Brown <broonie@kernel.org>, Rob Herring <robh@kernel.org>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Subject: [PATCH v1 2/5] spi: mpc5xxx-psc: Return immediately if IRQ resource is unavailable
Date: Mon,  6 Mar 2023 20:31:12 +0200	[thread overview]
Message-ID: <20230306183115.87314-3-andriy.shevchenko@linux.intel.com> (raw)
In-Reply-To: <20230306183115.87314-1-andriy.shevchenko@linux.intel.com>

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@linux.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


  parent reply	other threads:[~2023-03-06 18:30 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-06 18:31 [PATCH v1 0/5] spi: mpc5xxx-psc: Clean up even more and fix Andy Shevchenko
2023-03-06 18:31 ` [PATCH v1 1/5] spi: mpc5xxx-psc: Correct error check for devm_platform_get_and_ioremap_resource() Andy Shevchenko
2023-03-06 18:31 ` Andy Shevchenko [this message]
2023-03-06 18:31 ` [PATCH v1 3/5] spi: mpc5xxx-psc: use devm_clk_get_enabled() for core clock Andy Shevchenko
2023-03-06 18:31 ` [PATCH v1 4/5] spi: mpc5xxx-psc: Propagate firmware node Andy Shevchenko
2023-03-06 18:31 ` [PATCH v1 5/5] spi: mpc5xxx-psc: Consistently use device property APIs Andy Shevchenko
2023-03-08 13:53 ` [PATCH v1 0/5] spi: mpc5xxx-psc: Clean up even more and fix Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230306183115.87314-3-andriy.shevchenko@linux.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=broonie@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=robh@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).