Skip to content

Commit

Permalink
can: rcar_can: fix IRQ check
Browse files Browse the repository at this point in the history
rcar_can_probe() regards 0 as a wrong IRQ #, despite platform_get_irq() that it
calls returns negative error code in that case. This leads to the following
being printed to the console when attempting to open the device:

error requesting interrupt fffffffa

because  rcar_can_open() calls request_irq() with a negative IRQ #, and that
function naturally fails with -EINVAL.

Check for the negative error codes instead and propagate them upstream instead
of just returning -ENODEV.

Fixes: fd11593 ("can: add Renesas R-Car CAN driver")
Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Cc: linux-stable <stable@vger.kernel.org>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
  • Loading branch information
Sergei Shtylyov authored and Marc Kleine-Budde committed Jul 12, 2015
1 parent 2ee9401 commit 5e63e6b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/net/can/rcar_can.c
Original file line number Diff line number Diff line change
Expand Up @@ -758,8 +758,9 @@ static int rcar_can_probe(struct platform_device *pdev)
}

irq = platform_get_irq(pdev, 0);
if (!irq) {
if (irq < 0) {
dev_err(&pdev->dev, "No IRQ resource\n");
err = irq;
goto fail;
}

Expand Down

0 comments on commit 5e63e6b

Please sign in to comment.