serial: fsl_lpuart: Remove unneeded check for 'res'
authorFabio Estevam <fabio.estevam@freescale.com>
Fri, 7 Nov 2014 02:23:13 +0000 (00:23 -0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 7 Nov 2014 16:35:46 +0000 (08:35 -0800)
'res' will be automatically checked inside devm_ioremap_resource(), so there is
no need to explicitly perform a NULL check.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Acked-by: Jingchang Lu <jingchang.lu@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/fsl_lpuart.c

index 4e25772..73d939c 100644 (file)
@@ -1786,15 +1786,13 @@ static int lpuart_probe(struct platform_device *pdev)
        }
        sport->port.line = ret;
        sport->lpuart32 = of_device_is_compatible(np, "fsl,ls1021a-lpuart");
-       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       if (!res)
-               return -ENODEV;
 
-       sport->port.mapbase = res->start;
+       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
        sport->port.membase = devm_ioremap_resource(&pdev->dev, res);
        if (IS_ERR(sport->port.membase))
                return PTR_ERR(sport->port.membase);
 
+       sport->port.mapbase = res->start;
        sport->port.dev = &pdev->dev;
        sport->port.type = PORT_LPUART;
        sport->port.iotype = UPIO_MEM;