All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] serial: mxs-auart: Fix mxs_auart_set_ldisc()
@ 2014-11-12 17:35 Fabio Estevam
  2014-11-12 21:52 ` Janusz Użycki
  0 siblings, 1 reply; 2+ messages in thread
From: Fabio Estevam @ 2014-11-12 17:35 UTC (permalink / raw)
  To: gregkh; +Cc: j.uzycki, linux-serial, Fabio Estevam

From: Fabio Estevam <fabio.estevam@freescale.com>

Since commit 36a262782b04 ("serial: mxs-auart: enable PPS support")
the following build warning is seen:

drivers/tty/serial/mxs-auart.c:962:2: warning: initialization from
incompatible pointer type
  .set_ldisc      = mxs_auart_set_ldisc,
  ^
drivers/tty/serial/mxs-auart.c:962:2: warning: (near initialization
for 'mxs_auart_ops.set_ldisc')

The second argument of set_ldisc should be 'struct ktermios *termios', so
fix it accordingly. 

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
Janusz,

This is build-tested only. Please test it on real hardware, if possible.

 drivers/tty/serial/mxs-auart.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/tty/serial/mxs-auart.c b/drivers/tty/serial/mxs-auart.c
index 3784920..a6d2bb9f4 100644
--- a/drivers/tty/serial/mxs-auart.c
+++ b/drivers/tty/serial/mxs-auart.c
@@ -784,9 +784,10 @@ static void mxs_auart_settermios(struct uart_port *u,
 		mxs_auart_disable_ms(u);
 }
 
-static void mxs_auart_set_ldisc(struct uart_port *port, int new)
+static void mxs_auart_set_ldisc(struct uart_port *port,
+				struct ktermios *termios)
 {
-	if (new == N_PPS) {
+	if (termios->c_line == N_PPS) {
 		port->flags |= UPF_HARDPPS_CD;
 		mxs_auart_enable_ms(port);
 	} else {
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] serial: mxs-auart: Fix mxs_auart_set_ldisc()
  2014-11-12 17:35 [PATCH] serial: mxs-auart: Fix mxs_auart_set_ldisc() Fabio Estevam
@ 2014-11-12 21:52 ` Janusz Użycki
  0 siblings, 0 replies; 2+ messages in thread
From: Janusz Użycki @ 2014-11-12 21:52 UTC (permalink / raw)
  To: Fabio Estevam, gregkh; +Cc: linux-serial, Fabio Estevam

Thanks Fabio for the fix. I hope I will test it this week.
In fact, commit 36a262782b045220bfccf89bd2c4d78cbe152c8e
("serial: core: Pass termios to set_ldisc() notifications")
with the 36a262782b04 commit resulted in the problem.

I also noticed 2 successive patches in the next:
* d41510ce2f071c9ccb1903d7a5135443a57dbe4e
   ("serial: Take uart port lock for direct *_enable_ms()")
* cab68f89546ba5a04bf28aaeaca841d4ccc2fd52
   ("serial: Test/disable MSIs if switching from N_PPS")
should be applied for the patch. However they aren't critical.
I'll submit them after a patch which adds to mxs-auart driver spin-locks.

best regards
Janusz

W dniu 2014-11-12 o 18:35, Fabio Estevam pisze:
> From: Fabio Estevam <fabio.estevam@freescale.com>
>
> Since commit 36a262782b04 ("serial: mxs-auart: enable PPS support")
> the following build warning is seen:
>
> drivers/tty/serial/mxs-auart.c:962:2: warning: initialization from
> incompatible pointer type
>    .set_ldisc      = mxs_auart_set_ldisc,
>    ^
> drivers/tty/serial/mxs-auart.c:962:2: warning: (near initialization
> for 'mxs_auart_ops.set_ldisc')
>
> The second argument of set_ldisc should be 'struct ktermios *termios', so
> fix it accordingly.
>
> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
> ---
> Janusz,
>
> This is build-tested only. Please test it on real hardware, if possible.
>
>   drivers/tty/serial/mxs-auart.c | 5 +++--
>   1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/tty/serial/mxs-auart.c b/drivers/tty/serial/mxs-auart.c
> index 3784920..a6d2bb9f4 100644
> --- a/drivers/tty/serial/mxs-auart.c
> +++ b/drivers/tty/serial/mxs-auart.c
> @@ -784,9 +784,10 @@ static void mxs_auart_settermios(struct uart_port *u,
>   		mxs_auart_disable_ms(u);
>   }
>   
> -static void mxs_auart_set_ldisc(struct uart_port *port, int new)
> +static void mxs_auart_set_ldisc(struct uart_port *port,
> +				struct ktermios *termios)
>   {
> -	if (new == N_PPS) {
> +	if (termios->c_line == N_PPS) {
>   		port->flags |= UPF_HARDPPS_CD;
>   		mxs_auart_enable_ms(port);
>   	} else {


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-11-12 21:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-12 17:35 [PATCH] serial: mxs-auart: Fix mxs_auart_set_ldisc() Fabio Estevam
2014-11-12 21:52 ` Janusz Użycki

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.