netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Marc Kleine-Budde <mkl@pengutronix.de>
To: netdev@vger.kernel.org
Cc: davem@davemloft.net, kuba@kernel.org, linux-can@vger.kernel.org,
	kernel@pengutronix.de, Ruan Jinjie <ruanjinjie@huawei.com>,
	Marc Kleine-Budde <mkl@pengutronix.de>
Subject: [PATCH net-next 8/9] can: c_can: Do not check for 0 return after calling platform_get_irq()
Date: Thu,  3 Aug 2023 10:08:29 +0200	[thread overview]
Message-ID: <20230803080830.1386442-9-mkl@pengutronix.de> (raw)
In-Reply-To: <20230803080830.1386442-1-mkl@pengutronix.de>

From: Ruan Jinjie <ruanjinjie@huawei.com>

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>
Link: https://lore.kernel.org/all/20230802030900.2271322-1-ruanjinjie@huawei.com
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
 drivers/net/can/c_can/c_can_platform.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/can/c_can/c_can_platform.c b/drivers/net/can/c_can/c_can_platform.c
index 925930b6c4ca..f44ba2600415 100644
--- a/drivers/net/can/c_can/c_can_platform.c
+++ b/drivers/net/can/c_can/c_can_platform.c
@@ -285,8 +285,8 @@ static int c_can_plat_probe(struct platform_device *pdev)
 
 	/* get the platform data */
 	irq = platform_get_irq(pdev, 0);
-	if (irq <= 0) {
-		ret = -ENODEV;
+	if (irq < 0) {
+		ret = irq;
 		goto exit;
 	}
 
-- 
2.40.1



  parent reply	other threads:[~2023-08-03  8:08 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-03  8:08 [PATCH net-next 0/9] pull-request: can-next 2023-08-03 Marc Kleine-Budde
2023-08-03  8:08 ` [PATCH net-next 1/9] can: flexcan: fix the return value handle for platform_get_irq() Marc Kleine-Budde
2023-08-04  7:50   ` patchwork-bot+netdevbpf
2023-08-03  8:08 ` [PATCH net-next 2/9] dt-bindings: can: tcan4x5x: Add tcan4552 and tcan4553 variants Marc Kleine-Budde
2023-08-03  8:08 ` [PATCH net-next 3/9] can: tcan4x5x: Remove reserved register 0x814 from writable table Marc Kleine-Budde
2023-08-03  8:08 ` [PATCH net-next 4/9] can: tcan4x5x: Check size of mram configuration Marc Kleine-Budde
2023-08-03  8:08 ` [PATCH net-next 5/9] can: tcan4x5x: Rename ID registers to match datasheet Marc Kleine-Budde
2023-08-03  8:08 ` [PATCH net-next 6/9] can: tcan4x5x: Add support for tcan4552/4553 Marc Kleine-Budde
2023-08-03  8:08 ` [PATCH net-next 7/9] can: tcan4x5x: Add error messages in probe Marc Kleine-Budde
2023-08-03  8:08 ` Marc Kleine-Budde [this message]
2023-08-03  8:08 ` [PATCH net-next 9/9] can: esd_usb: Add support for esd CAN-USB/3 Marc Kleine-Budde

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=20230803080830.1386442-9-mkl@pengutronix.de \
    --to=mkl@pengutronix.de \
    --cc=davem@davemloft.net \
    --cc=kernel@pengutronix.de \
    --cc=kuba@kernel.org \
    --cc=linux-can@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=ruanjinjie@huawei.com \
    /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).