serial: bcm2835: fix unsigned int issue with irq
authorMartin Sperl <kernel@martin.sperl.org>
Tue, 9 Feb 2016 11:47:16 +0000 (11:47 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 15 Feb 2016 01:39:36 +0000 (17:39 -0800)
Fixes error condition check when requesting the irq,
that would not trigger because of uart_port.irq being
defined as unsigned int.

Reported by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Martin Sperl <kernel@martin.sperl.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/8250/8250_bcm2835aux.c

index ecf89f13a13b6be93ec30ba314fbb1852ea084b7..e10f1244409b344b850ffbbd4af5757a66c875f1 100644 (file)
@@ -59,12 +59,12 @@ static int bcm2835aux_serial_probe(struct platform_device *pdev)
        }
 
        /* get the interrupt */
-       data->uart.port.irq = platform_get_irq(pdev, 0);
-       if (data->uart.port.irq < 0) {
-               dev_err(&pdev->dev, "irq not found - %i",
-                       data->uart.port.irq);
-               return data->uart.port.irq;
+       ret = platform_get_irq(pdev, 0);
+       if (ret < 0) {
+               dev_err(&pdev->dev, "irq not found - %i", ret);
+               return ret;
        }
+       data->uart.port.irq = ret;
 
        /* map the main registers */
        res = platform_get_resource(pdev, IORESOURCE_MEM, 0);