From: Richard Zhao Date: Tue, 18 Sep 2012 08:14:59 +0000 (+0800) Subject: serial: imx: remove null check of sport in suspend/resume function X-Git-Tag: firefly_0821_release~3680^2~1976^2~24 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=034dc4db6fefa8b9b55a20e816a05f132fdd56bc;p=firefly-linux-kernel-4.4.55.git 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 Acked-by: Shawn Guo Signed-off-by: Greg Kroah-Hartman --- 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) val |= UCR3_AWAKEN; writel(val, sport->port.membase + UCR3); - if (sport) - uart_suspend_port(&imx_reg, &sport->port); + uart_suspend_port(&imx_reg, &sport->port); return 0; } @@ -1389,8 +1388,7 @@ static int serial_imx_resume(struct platform_device *dev) val &= ~UCR3_AWAKEN; writel(val, sport->port.membase + UCR3); - if (sport) - uart_resume_port(&imx_reg, &sport->port); + uart_resume_port(&imx_reg, &sport->port); return 0; }