]> www.infradead.org Git - users/jedix/linux-maple.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 10 Aug 2015 19:21:51 +0000 (12:21 -0700)
commit78574b4bdc49fb0d7d5d3218beb069d259b2b631
treea96317c61d000e93097e8f9a81ab5c6c82834dbb
parent153fa24b8f6763c51915c59feed10dad045bd880
can: rcar_can: fix IRQ check

commit 5e63e6baa159fa8c787cf783dbf3d77fbea97331 upstream.

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: fd1159318e55 ("can: add Renesas R-Car CAN driver")
Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/can/rcar_can.c