* [PATCH net-next] can: c_can: Do not check for 0 return after calling platform_get_irq()
@ 2023-08-02 3:09 Ruan Jinjie
2023-08-02 8:59 ` Marc Kleine-Budde
0 siblings, 1 reply; 2+ messages in thread
From: Ruan Jinjie @ 2023-08-02 3:09 UTC (permalink / raw)
To: wg, mkl, davem, edumazet, kuba, pabeni, u.kleine-koenig,
chi.minghao, linux-can, netdev
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/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.34.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH net-next] can: c_can: Do not check for 0 return after calling platform_get_irq()
2023-08-02 3:09 [PATCH net-next] can: c_can: Do not check for 0 return after calling platform_get_irq() Ruan Jinjie
@ 2023-08-02 8:59 ` Marc Kleine-Budde
0 siblings, 0 replies; 2+ messages in thread
From: Marc Kleine-Budde @ 2023-08-02 8:59 UTC (permalink / raw)
To: Ruan Jinjie
Cc: wg, davem, edumazet, kuba, pabeni, u.kleine-koenig, chi.minghao,
linux-can, netdev
[-- Attachment #1: Type: text/plain, Size: 532 bytes --]
On 02.08.2023 11:09:00, 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>
Applied to linux-can-next/testing.
Thanks,
Marc
--
Pengutronix e.K. | Marc Kleine-Budde |
Embedded Linux | https://www.pengutronix.de |
Vertretung Nürnberg | Phone: +49-5121-206917-129 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-9 |
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-08-02 8:59 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-02 3:09 [PATCH net-next] can: c_can: Do not check for 0 return after calling platform_get_irq() Ruan Jinjie
2023-08-02 8:59 ` Marc Kleine-Budde
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).