diff options
author | Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> | 2015-06-20 03:32:46 +0300 |
---|---|---|
committer | Marc Kleine-Budde <mkl@pengutronix.de> | 2015-07-12 20:57:41 +0200 |
commit | 5e63e6baa159fa8c787cf783dbf3d77fbea97331 (patch) | |
tree | 8406c8f34f1abf9d89ec785a3d3c88df234fbb3e /drivers/net | |
parent | 2ee94014d9bd3868b1c0d17405f96d63bec83f28 (diff) | |
download | linux-stable-5e63e6baa159fa8c787cf783dbf3d77fbea97331.tar.gz linux-stable-5e63e6baa159fa8c787cf783dbf3d77fbea97331.tar.bz2 linux-stable-5e63e6baa159fa8c787cf783dbf3d77fbea97331.zip |
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: fd1159318e55 ("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>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/can/rcar_can.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/can/rcar_can.c b/drivers/net/can/rcar_can.c index 7deb80dcbe8c..93017c09cfc3 100644 --- a/drivers/net/can/rcar_can.c +++ b/drivers/net/can/rcar_can.c @@ -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; } |