RE: [PATCH 1/2] serial: fsl_lpuart: Remove unneeded check for 'res'

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>-----Original Message-----
>From: Fabio Estevam [mailto:festevam@xxxxxxxxx]
>Sent: Friday, November 07, 2014 10:23 AM
>To: gregkh@xxxxxxxxxxxxxxxxxxx
>Cc: Lu Jingchang-B35083; linux-serial@xxxxxxxxxxxxxxx; Estevam Fabio-
>R49496
>Subject: [PATCH 1/2] serial: fsl_lpuart: Remove unneeded check for 'res'
>
>From: Fabio Estevam <fabio.estevam@xxxxxxxxxxxxx>
>
>'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@xxxxxxxxxxxxx>

Acked-by: Jingchang Lu <jingchang.lu@xxxxxxxxxxxxx>

>---
> drivers/tty/serial/fsl_lpuart.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
>diff --git a/drivers/tty/serial/fsl_lpuart.c
>b/drivers/tty/serial/fsl_lpuart.c
>index 6dd53af..567d0ad 100644
>--- a/drivers/tty/serial/fsl_lpuart.c
>+++ b/drivers/tty/serial/fsl_lpuart.c
>@@ -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;
>--
>1.9.1

��.n��������+%������w��{.n�����{��ǫ����{ay�ʇڙ���f���h������_�(�階�ݢj"��������G����?���&��





[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux PPP]     [Linux FS]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Linmodem]     [Device Mapper]     [Linux Kernel for ARM]

  Powered by Linux