serial: fsl_lpuart: Remove unneeded check for 'res'
PATCH 1/2 serial: fsl_lpuart: Remove unneeded check for 'res'
From: Fabio Estevam <[email protected]>
'res' will be automatically checked inside devm_ioremap_resource(), so there is no need to explicitly perform a NULL check.
--- drivers/tty/serial/fsl_lpuart.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/tty/serial/fsl_lpuart.c +2 -4
@@ -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 ;
Signature · 1 line
1.9.1
PATCH 2/2 serial: fsl_lpuart: Remove unneeded registration message
From: Fabio Estevam <[email protected]>
There is no real value in displaying "serial: Freescale lpuart driver" in every boot.
The uart_register_driver() can fail and even so the "serial: Freescale lpuart driver" will be displayed, which is not really helpful.
This is particularly annoying when booting multi_v7_defconfig kernel on a SoC that is not a Vybrid/Layerscape and even though this message gets displayed.
--- drivers/tty/serial/fsl_lpuart.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/tty/serial/fsl_lpuart.c +1 -4
@@ -1882,11 +1882,8 @@ static struct platform_driver lpuart_driver = {static int __init lpuart_serial_init (void ) { -int ret; - -pr_info ("serial: Freescale lpuart driver\n" ); +int ret =uart_register_driver (&lpuart_reg); - ret =uart_register_driver (&lpuart_reg);if (ret)return ret;
Signature · 1 line
1.9.1
RE: [PATCH 2/2] serial: fsl_lpuart: Remove unneeded registration message
Quoted 14 lines
-----Original Message-----
From: Fabio Estevam [mailto:[email protected]]
Sent: Friday, November 07, 2014 10:23 AM
To: [email protected]
Cc: Lu Jingchang-B35083; [email protected]; Estevam Fabio- R49496
Subject: [PATCH 2/2] serial:fsl_lpuart: Remove unneeded registration messageFrom: Fabio Estevam <[email protected]>
There is no real value in displaying "serial: Freescale lpuart driver" in every boot.
Quoted 8 lines
The
uart_register_driver()can fail and even so the "serial: Freescale lpuart driver" will be displayed, which is not really helpful.This is particularly annoying when booting
multi_v7_defconfigkernel on a SoC that is not a Vybrid/Layerscape and even though this message gets displayed.Signed-off-by Fabio Estevam <[email protected]>
Quoted 22 lines
---
drivers/tty/serial/fsl_lpuart.c| 5 +----1 file changed, 1 insertion(+), 4 deletions(-)(quoted diff) +0
-0
b/drivers/tty/serial/fsl_lpuart.cindex 567d0ad..08c8651 100644drivers/tty/serial/fsl_lpuart.c +1
-5@@ -1882,11 +1882,8 @@ static struct platform_driver lpuart_driver = {static int __init lpuart_serial_init (void ) { -int ret; - -pr_info ("serial: Freescale lpuart driver\n" ); +int ret =uart_register_driver (&lpuart_reg); - ret =uart_register_driver (&lpuart_reg);if (ret)return ret; --1.9.1
Quoted 8 lines
-----Original Message-----
From: Fabio Estevam [mailto:[email protected]]
Sent: Friday, November 07, 2014 10:23 AM
To: [email protected]
Cc: Lu Jingchang-B35083; [email protected]; Estevam Fabio- R49496
Subject: [PATCH 1/2] serial:fsl_lpuart: Remove unneeded check for 'res'
Quoted 7 lines
From: Fabio Estevam <[email protected]>
'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 <[email protected]>
Quoted 30 lines
---
drivers/tty/serial/fsl_lpuart.c| 6 ++----1 file changed, 2 insertions(+), 4 deletions(-)drivers/tty/serial/fsl_lpuart.c +2
-4@@ -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