Message ID | 20170303232305.GU996@jhogan-linux.le.imgtec.org (mailing list archive) |
---|---|
State | Not Applicable |
Headers | show |
On Sat, Mar 4, 2017 at 1:23 AM, James Hogan <james.hogan@imgtec.com> wrote: > On Fri, Mar 03, 2017 at 03:31:06PM +0200, Andy Shevchenko wrote: >> On Fri, 2017-03-03 at 00:21 +0000, James Hogan wrote: >> > The CONFIG_HAVE_CLK=n implementation of devm_clk_get() in particular >> > seems highly questionable to me, given that commit 93abe8e4b13a ("clk: >> > add non CONFIG_HAVE_CLK routines") which added it 5 years ago says: >> Btw, I hope you also noticed this one: >> >> http://www.spinics.net/lists/linux-serial/msg25314.html > > Interesting. > > Following Russel's past advise[1], the following patch on top of Heiko's > patch also fixes things for me on Octeon: > > [1] https://lists.gt.net/linux/kernel/2102623 > > If thats an acceptable fix I'll post it properly. Thoughts? Fine by me. Looks definitely better than IS_ERR_OR_NULL(). Please, submit as usual with your SoB tag. > diff --git a/drivers/tty/serial/8250/8250_dw.c b/drivers/tty/serial/8250/8250_dw.c > index 223ac234ddb2..e65808c482f1 100644 > --- a/drivers/tty/serial/8250/8250_dw.c > +++ b/drivers/tty/serial/8250/8250_dw.c > @@ -267,6 +267,8 @@ static void dw8250_set_termios(struct uart_port *p, struct ktermios *termios, > rate = clk_round_rate(d->clk, baud * 16); > if (rate < 0) > ret = rate; > + else if (rate == 0) > + ret = -ENOENT; > else > ret = clk_set_rate(d->clk, rate); > clk_prepare_enable(d->clk);
diff --git a/drivers/tty/serial/8250/8250_dw.c b/drivers/tty/serial/8250/8250_dw.c index 223ac234ddb2..e65808c482f1 100644 --- a/drivers/tty/serial/8250/8250_dw.c +++ b/drivers/tty/serial/8250/8250_dw.c @@ -267,6 +267,8 @@ static void dw8250_set_termios(struct uart_port *p, struct ktermios *termios, rate = clk_round_rate(d->clk, baud * 16); if (rate < 0) ret = rate; + else if (rate == 0) + ret = -ENOENT; else ret = clk_set_rate(d->clk, rate); clk_prepare_enable(d->clk);