linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] spi: Do not check for 0 return after calling platform_get_irq()
@ 2023-08-02  9:32 Ruan Jinjie
  2023-08-02 16:58 ` Florian Fainelli
  2023-08-07 17:37 ` Mark Brown
  0 siblings, 2 replies; 3+ messages in thread
From: Ruan Jinjie @ 2023-08-02  9:32 UTC (permalink / raw)
  To: broonie, florian.fainelli, bcm-kernel-feedback-list, rjui,
	sbranden, linux-spi, linux-rpi-kernel, linux-arm-kernel
  Cc: ruanjinjie

It is not possible for platform_get_irq() to return 0. Use the
return value from platform_get_irq().

Signed-off-by: Ruan Jinjie <ruanjinjie@huawei.com>
---
 drivers/spi/spi-axi-spi-engine.c | 4 ++--
 drivers/spi/spi-bcm2835.c        | 4 ++--
 drivers/spi/spi-bcm2835aux.c     | 4 ++--
 drivers/spi/spi-cadence.c        | 4 ++--
 4 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/spi/spi-axi-spi-engine.c b/drivers/spi/spi-axi-spi-engine.c
index 89661f3b0d44..c3224b85bc79 100644
--- a/drivers/spi/spi-axi-spi-engine.c
+++ b/drivers/spi/spi-axi-spi-engine.c
@@ -470,8 +470,8 @@ static int spi_engine_probe(struct platform_device *pdev)
 	int ret;
 
 	irq = platform_get_irq(pdev, 0);
-	if (irq <= 0)
-		return -ENXIO;
+	if (irq < 0)
+		return irq;
 
 	spi_engine = devm_kzalloc(&pdev->dev, sizeof(*spi_engine), GFP_KERNEL);
 	if (!spi_engine)
diff --git a/drivers/spi/spi-bcm2835.c b/drivers/spi/spi-bcm2835.c
index c16abc2a9e9b..3f7f61ba66d5 100644
--- a/drivers/spi/spi-bcm2835.c
+++ b/drivers/spi/spi-bcm2835.c
@@ -1360,8 +1360,8 @@ static int bcm2835_spi_probe(struct platform_device *pdev)
 	ctlr->max_speed_hz = clk_get_rate(bs->clk) / 2;
 
 	bs->irq = platform_get_irq(pdev, 0);
-	if (bs->irq <= 0)
-		return bs->irq ? bs->irq : -ENODEV;
+	if (bs->irq < 0)
+		return bs->irq;
 
 	err = clk_prepare_enable(bs->clk);
 	if (err)
diff --git a/drivers/spi/spi-bcm2835aux.c b/drivers/spi/spi-bcm2835aux.c
index 8ace417c0a29..843dac847584 100644
--- a/drivers/spi/spi-bcm2835aux.c
+++ b/drivers/spi/spi-bcm2835aux.c
@@ -520,8 +520,8 @@ static int bcm2835aux_spi_probe(struct platform_device *pdev)
 	}
 
 	bs->irq = platform_get_irq(pdev, 0);
-	if (bs->irq <= 0)
-		return bs->irq ? bs->irq : -ENODEV;
+	if (bs->irq < 0)
+		return bs->irq;
 
 	/* this also enables the HW block */
 	err = clk_prepare_enable(bs->clk);
diff --git a/drivers/spi/spi-cadence.c b/drivers/spi/spi-cadence.c
index 42f101d357c3..7b0136536cfb 100644
--- a/drivers/spi/spi-cadence.c
+++ b/drivers/spi/spi-cadence.c
@@ -627,8 +627,8 @@ static int cdns_spi_probe(struct platform_device *pdev)
 	cdns_spi_init_hw(xspi, spi_controller_is_slave(ctlr));
 
 	irq = platform_get_irq(pdev, 0);
-	if (irq <= 0) {
-		ret = -ENXIO;
+	if (irq < 0) {
+		ret = irq;
 		goto clk_dis_all;
 	}
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH -next] spi: Do not check for 0 return after calling platform_get_irq()
  2023-08-02  9:32 [PATCH -next] spi: Do not check for 0 return after calling platform_get_irq() Ruan Jinjie
@ 2023-08-02 16:58 ` Florian Fainelli
  2023-08-07 17:37 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Florian Fainelli @ 2023-08-02 16:58 UTC (permalink / raw)
  To: Ruan Jinjie, broonie, bcm-kernel-feedback-list, rjui, sbranden,
	linux-spi, linux-rpi-kernel, linux-arm-kernel

[-- Attachment #1: Type: text/plain, Size: 291 bytes --]

On 8/2/23 02:32, Ruan Jinjie wrote:
> It is not possible for platform_get_irq() to return 0. Use the
> return value from platform_get_irq().
> 
> Signed-off-by: Ruan Jinjie <ruanjinjie@huawei.com>

Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com> # 
spi-bcm2835*.c
-- 
Florian


[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4221 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH -next] spi: Do not check for 0 return after calling platform_get_irq()
  2023-08-02  9:32 [PATCH -next] spi: Do not check for 0 return after calling platform_get_irq() Ruan Jinjie
  2023-08-02 16:58 ` Florian Fainelli
@ 2023-08-07 17:37 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2023-08-07 17:37 UTC (permalink / raw)
  To: florian.fainelli, bcm-kernel-feedback-list, rjui, sbranden,
	linux-spi, linux-rpi-kernel, linux-arm-kernel, Ruan Jinjie

On Wed, 02 Aug 2023 17:32:38 +0800, Ruan Jinjie wrote:
> It is not possible for platform_get_irq() to return 0. Use the
> return value from platform_get_irq().
> 
> 

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next

Thanks!

[1/1] spi: Do not check for 0 return after calling platform_get_irq()
      commit: 8102d64c04e8ead02c30bb07ff7dd5c41ed61bce

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-08-07 17:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-02  9:32 [PATCH -next] spi: Do not check for 0 return after calling platform_get_irq() Ruan Jinjie
2023-08-02 16:58 ` Florian Fainelli
2023-08-07 17:37 ` Mark Brown

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