• Sergei Shtylyov's avatar
    can: rcar_can: fix IRQ check · 5e63e6ba
    Sergei Shtylyov authored
    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: fd115931 ("can: add Renesas R-Car CAN driver")
    Signed-off-by: default avatarSergei Shtylyov <sergei.shtylyov@cogentembedded.com>
    Cc: linux-stable <stable@vger.kernel.org>
    Signed-off-by: default avatarMarc Kleine-Budde <mkl@pengutronix.de>
    5e63e6ba
rcar_can.c 26.9 KB