Skip to content

Commit

Permalink
serial: imx: remove null check of sport in suspend/resume function
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Richard Zhao authored and Greg Kroah-Hartman committed Sep 21, 2012
1 parent 0a86a86 commit 034dc4d
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions drivers/tty/serial/imx.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -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;
}
Expand Down

0 comments on commit 034dc4d

Please sign in to comment.