can: c_can: Do not check for 0 return after calling platform_get_irq()
authorRuan Jinjie <ruanjinjie@huawei.com>
Wed, 2 Aug 2023 03:09:00 +0000 (11:09 +0800)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Wed, 2 Aug 2023 06:19:20 +0000 (08:19 +0200)
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

index 925930b..f44ba26 100644 (file)
@@ -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;
        }