]> git.baikalelectronics.ru Git - kernel.git/commit
can: rcar_can: fix IRQ check
authorSergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Sat, 20 Jun 2015 00:32:46 +0000 (03:32 +0300)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Sun, 12 Jul 2015 18:57:41 +0000 (20:57 +0200)
commiteee782b6a0dfe262afb63a333f4123a94bd7f858
tree8406c8f34f1abf9d89ec785a3d3c88df234fbb3e
parentc6fd45538d1094677aa39c18fd46af12cca11a8f
can: rcar_can: fix IRQ check

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: 108be5a3c99d ("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>
drivers/net/can/rcar_can.c