Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 034dc4db authored by Richard Zhao's avatar Richard Zhao Committed by Greg Kroah-Hartman
Browse files

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: default avatarRichard Zhao <richard.zhao@freescale.com>
Acked-by: default avatarShawn Guo <shawn.guo@linaro.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 0a86a86b
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -1373,7 +1373,6 @@ 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);

	return 0;
@@ -1389,7 +1388,6 @@ 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);

	return 0;