diff mbox

[v5,16/17] tty: serdev-ttyport: return actual baudrate from ttyport_set_baudrate

Message ID 1494406408-31760-17-git-send-email-stefan.wahren@i2se.com
State Changes Requested, archived
Delegated to: David Miller
Headers show

Commit Message

Stefan Wahren May 10, 2017, 8:53 a.m. UTC
Instead of returning the requested baudrate, we better return the
actual one because it isn't always the same.

Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Acked-by: Rob Herring <robh@kernel.org>
---
 drivers/tty/serdev/serdev-ttyport.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Stefan Wahren May 17, 2017, 11:58 a.m. UTC | #1
Hi Greg,

Am 10.05.2017 um 10:53 schrieb Stefan Wahren:
> Instead of returning the requested baudrate, we better return the
> actual one because it isn't always the same.
>
> Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
> Acked-by: Rob Herring <robh@kernel.org>
> ---
>  drivers/tty/serdev/serdev-ttyport.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/tty/serdev/serdev-ttyport.c b/drivers/tty/serdev/serdev-ttyport.c
> index 487c88f..2cfdf34 100644
> --- a/drivers/tty/serdev/serdev-ttyport.c
> +++ b/drivers/tty/serdev/serdev-ttyport.c
> @@ -151,7 +151,7 @@ static unsigned int ttyport_set_baudrate(struct serdev_controller *ctrl, unsigne
>  
>  	/* tty_set_termios() return not checked as it is always 0 */
>  	tty_set_termios(tty, &ktermios);
> -	return speed;
> +	return ktermios.c_ospeed;
>  }
>  
>  static void ttyport_set_flow_control(struct serdev_controller *ctrl, bool enable)

there is no dependency to this series. I would be happy if this could be
applied, so i don't have to carry it for the next version.

Thanks
Stefan
gregkh@linuxfoundation.org May 18, 2017, 2:19 p.m. UTC | #2
On Wed, May 17, 2017 at 01:58:05PM +0200, Stefan Wahren wrote:
> Hi Greg,
> 
> Am 10.05.2017 um 10:53 schrieb Stefan Wahren:
> > Instead of returning the requested baudrate, we better return the
> > actual one because it isn't always the same.
> >
> > Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
> > Acked-by: Rob Herring <robh@kernel.org>
> > ---
> >  drivers/tty/serdev/serdev-ttyport.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/tty/serdev/serdev-ttyport.c b/drivers/tty/serdev/serdev-ttyport.c
> > index 487c88f..2cfdf34 100644
> > --- a/drivers/tty/serdev/serdev-ttyport.c
> > +++ b/drivers/tty/serdev/serdev-ttyport.c
> > @@ -151,7 +151,7 @@ static unsigned int ttyport_set_baudrate(struct serdev_controller *ctrl, unsigne
> >  
> >  	/* tty_set_termios() return not checked as it is always 0 */
> >  	tty_set_termios(tty, &ktermios);
> > -	return speed;
> > +	return ktermios.c_ospeed;
> >  }
> >  
> >  static void ttyport_set_flow_control(struct serdev_controller *ctrl, bool enable)
> 
> there is no dependency to this series. I would be happy if this could be
> applied, so i don't have to carry it for the next version.

Ok, I'll take it now.

thanks,

greg k-h
diff mbox

Patch

diff --git a/drivers/tty/serdev/serdev-ttyport.c b/drivers/tty/serdev/serdev-ttyport.c
index 487c88f..2cfdf34 100644
--- a/drivers/tty/serdev/serdev-ttyport.c
+++ b/drivers/tty/serdev/serdev-ttyport.c
@@ -151,7 +151,7 @@  static unsigned int ttyport_set_baudrate(struct serdev_controller *ctrl, unsigne
 
 	/* tty_set_termios() return not checked as it is always 0 */
 	tty_set_termios(tty, &ktermios);
-	return speed;
+	return ktermios.c_ospeed;
 }
 
 static void ttyport_set_flow_control(struct serdev_controller *ctrl, bool enable)