diff options
author | Tomasz Figa <t.figa@samsung.com> | 2013-05-08 18:30:30 +0200 |
---|---|---|
committer | Marek Szyprowski <m.szyprowski@samsung.com> | 2014-05-15 07:20:10 +0200 |
commit | 290e41c3a64fd291d58e0b57a3d877d7d2e5b47a (patch) | |
tree | 46f7cf08fc68f371bd91b30318a21dd2f729b286 /drivers/tty/serial | |
parent | bf1232e3361cb4c9ace6b36d45ca437504555a86 (diff) | |
download | linux-3.10-290e41c3a64fd291d58e0b57a3d877d7d2e5b47a.tar.gz linux-3.10-290e41c3a64fd291d58e0b57a3d877d7d2e5b47a.tar.bz2 linux-3.10-290e41c3a64fd291d58e0b57a3d877d7d2e5b47a.zip |
tty: serial: samsung: Remove useless checks in suspend/resume callbacks
Since uart_port struct exists through whole driver lifetime, there is no
need to check if it is non-NULL in suspend/resume callbacks.
Signed-off-by: Tomasz Figa <t.figa@samsung.com>
Diffstat (limited to 'drivers/tty/serial')
-rw-r--r-- | drivers/tty/serial/samsung.c | 31 |
1 files changed, 13 insertions, 18 deletions
diff --git a/drivers/tty/serial/samsung.c b/drivers/tty/serial/samsung.c index 0c8a9fa2be6..12bb5d877d3 100644 --- a/drivers/tty/serial/samsung.c +++ b/drivers/tty/serial/samsung.c @@ -1307,8 +1307,7 @@ static int s3c24xx_serial_suspend(struct device *dev) { struct uart_port *port = s3c24xx_dev_to_port(dev); - if (port) - uart_suspend_port(&s3c24xx_uart_drv, port); + uart_suspend_port(&s3c24xx_uart_drv, port); return 0; } @@ -1318,13 +1317,11 @@ static int s3c24xx_serial_resume(struct device *dev) struct uart_port *port = s3c24xx_dev_to_port(dev); struct s3c24xx_uart_port *ourport = to_ourport(port); - if (port) { - clk_prepare_enable(ourport->clk); - s3c24xx_serial_resetport(port, s3c24xx_port_to_cfg(port)); - clk_disable_unprepare(ourport->clk); + clk_prepare_enable(ourport->clk); + s3c24xx_serial_resetport(port, s3c24xx_port_to_cfg(port)); + clk_disable_unprepare(ourport->clk); - uart_resume_port(&s3c24xx_uart_drv, port); - } + uart_resume_port(&s3c24xx_uart_drv, port); return 0; } @@ -1333,16 +1330,14 @@ static int s3c24xx_serial_resume_noirq(struct device *dev) { struct uart_port *port = s3c24xx_dev_to_port(dev); - if (port) { - /* restore IRQ mask */ - if (s3c24xx_serial_has_interrupt_mask(port)) { - unsigned int uintm = 0xf; - if (tx_enabled(port)) - uintm &= ~S3C64XX_UINTM_TXD_MSK; - if (rx_enabled(port)) - uintm &= ~S3C64XX_UINTM_RXD_MSK; - wr_regl(port, S3C64XX_UINTM, uintm); - } + /* restore IRQ mask */ + if (s3c24xx_serial_has_interrupt_mask(port)) { + unsigned int uintm = 0xf; + if (tx_enabled(port)) + uintm &= ~S3C64XX_UINTM_TXD_MSK; + if (rx_enabled(port)) + uintm &= ~S3C64XX_UINTM_RXD_MSK; + wr_regl(port, S3C64XX_UINTM, uintm); } return 0; |