From c0ef8f258f87a8da6ffec19f963f3d9a657dcd84 Mon Sep 17 00:00:00 2001 From: Joel Stanley Date: Mon, 2 Jun 2014 14:58:10 +0930 Subject: [PATCH] Update use of Linux tty api MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit The following commit changed the api: commit 05c7cd39907184328f48d3e7899f9cdd653ad336 Author: Jiri Slaby Date: Thu Jan 3 15:53:04 2013 +0100 TTY: switch tty_insert_flip_string Fixes the following build failures against 3.13: In file included from xr21v141x-lnx-3.5-pak/vizzini.c:39:0: include/linux/tty_flip.h:29:19: note: expected ‘struct tty_port *’ but argument is of type ‘struct tty_struct *’ static inline int tty_insert_flip_string(struct tty_port *port, ^ xr21v141x-lnx-3.5-pak/vizzini.c:364:2: warning: passing argument 1 of ‘tty_flip_buffer_push’ from incompatible pointer type [enabled by default] tty_flip_buffer_push(tty); ^ In file included from xr21v141x-lnx-3.5-pak/vizzini.c:39:0: include/linux/tty_flip.h:14:13: note: expected ‘struct tty_port *’ but argument is of type ‘struct tty_struct *’ extern void tty_flip_buffer_push(struct tty_port *port); ^ Signed-off-by: Joel Stanley --- vizzini.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/vizzini.c b/vizzini.c index bce16dc..9c08e01 100644 --- a/vizzini.c +++ b/vizzini.c @@ -351,19 +351,11 @@ static int xr21v141x_submit_read_urbs(struct xr21v141x *xr21v141x, gfp_t mem_fla static void xr21v141x_process_read_urb(struct xr21v141x *xr21v141x, struct urb *urb) { - struct tty_struct *tty; - if (!urb->actual_length) return; - tty = tty_port_tty_get(&xr21v141x->port); - if (!tty) - return; - - tty_insert_flip_string(tty, urb->transfer_buffer, urb->actual_length); - tty_flip_buffer_push(tty); - - tty_kref_put(tty); + tty_insert_flip_string(&xr21v141x->port, urb->transfer_buffer, urb->actual_length); + tty_flip_buffer_push(&xr21v141x->port); } static void xr21v141x_read_bulk_callback(struct urb *urb) -- 2.39.2