Skip to content

Commit

Permalink
can: c_can: Do not check for 0 return after calling platform_get_irq()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Ruan Jinjie authored and Marc Kleine-Budde committed Aug 2, 2023
1 parent 7016198 commit db31e6f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/net/can/c_can/c_can_platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit db31e6f

Please sign in to comment.