aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/tty/serial/imx.c
diff options
context:
space:
mode:
authorRichard Zhao <richard.zhao@freescale.com>2012-09-18 04:14:59 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-09-21 12:53:16 -0400
commit034dc4db6fefa8b9b55a20e816a05f132fdd56bc (patch)
tree9f90ed40e8c427ecdc8f155f3e7773846d8d62d7 /drivers/tty/serial/imx.c
parent0a86a86b92312dacf74008ea1e1f4df20362f9f4 (diff)
serial: imx: remove null check of sport in suspend/resume function
platform_get_drvdata always retrun a valid value after probe succeed. It also fixed smatch warnings: drivers/tty/serial/imx.c:1376 serial_imx_suspend() warn: variable dereferenced before check 'sport' (see line 1372) drivers/tty/serial/imx.c:1392 serial_imx_resume() warn: variable dereferenced before check 'sport' (see line 1388) Signed-off-by: Richard Zhao <richard.zhao@freescale.com> Acked-by: Shawn Guo <shawn.guo@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/serial/imx.c')
-rw-r--r--drivers/tty/serial/imx.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c
index 49f664f72870..efeb8becfa43 100644
--- a/drivers/tty/serial/imx.c
+++ b/drivers/tty/serial/imx.c
@@ -1373,8 +1373,7 @@ static int serial_imx_suspend(struct platform_device *dev, pm_message_t state)
1373 val |= UCR3_AWAKEN; 1373 val |= UCR3_AWAKEN;
1374 writel(val, sport->port.membase + UCR3); 1374 writel(val, sport->port.membase + UCR3);
1375 1375
1376 if (sport) 1376 uart_suspend_port(&imx_reg, &sport->port);
1377 uart_suspend_port(&imx_reg, &sport->port);
1378 1377
1379 return 0; 1378 return 0;
1380} 1379}
@@ -1389,8 +1388,7 @@ static int serial_imx_resume(struct platform_device *dev)
1389 val &= ~UCR3_AWAKEN; 1388 val &= ~UCR3_AWAKEN;
1390 writel(val, sport->port.membase + UCR3); 1389 writel(val, sport->port.membase + UCR3);
1391 1390
1392 if (sport) 1391 uart_resume_port(&imx_reg, &sport->port);
1393 uart_resume_port(&imx_reg, &sport->port);
1394 1392
1395 return 0; 1393 return 0;
1396} 1394}