summaryrefslogtreecommitdiffstats
path: root/drivers/tty/serial/8250/8250_dw.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-03-29 08:58:53 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-03-29 08:58:53 +0200
commit53c1cf42817899f88114c28c6bbe4fe0f3c8afb6 (patch)
tree57bff7c4bb6e14af2e98d4f4b170abf06cf95415 /drivers/tty/serial/8250/8250_dw.c
parentRevert "tty: Fix ldisc crash on reopened tty" (diff)
parentLinux 4.11-rc4 (diff)
downloadlinux-53c1cf42817899f88114c28c6bbe4fe0f3c8afb6.tar.xz
linux-53c1cf42817899f88114c28c6bbe4fe0f3c8afb6.zip
Merge 4.11-rc4 into tty-next
We want the tty/serial fixes in here to handle bugfixes and merge issues. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/serial/8250/8250_dw.c')
-rw-r--r--drivers/tty/serial/8250/8250_dw.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/tty/serial/8250/8250_dw.c b/drivers/tty/serial/8250/8250_dw.c
index e0215db44e6e..787b1160d3a5 100644
--- a/drivers/tty/serial/8250/8250_dw.c
+++ b/drivers/tty/serial/8250/8250_dw.c
@@ -257,7 +257,7 @@ static void dw8250_set_termios(struct uart_port *p, struct ktermios *termios,
{
unsigned int baud = tty_termios_baud_rate(termios);
struct dw8250_data *d = p->private_data;
- unsigned int rate;
+ long rate;
int ret;
if (IS_ERR(d->clk) || !old)
@@ -265,7 +265,12 @@ static void dw8250_set_termios(struct uart_port *p, struct ktermios *termios,
clk_disable_unprepare(d->clk);
rate = clk_round_rate(d->clk, baud * 16);
- ret = clk_set_rate(d->clk, rate);
+ if (rate < 0)
+ ret = rate;
+ else if (rate == 0)
+ ret = -ENOENT;
+ else
+ ret = clk_set_rate(d->clk, rate);
clk_prepare_enable(d->clk);
if (!ret)