TTY: convert more flipping functions
Now, we start converting tty buffer functions to actually use tty_port. This will allow us to get rid of the need of tty pointer in many call sites. Only tty_port will be needed and hence no more tty_port_tty_get calls in those paths. Now 4 string flipping ones are on turn: * tty_insert_flip_string_flags * tty_insert_flip_string_fixed_flag * tty_prepare_flip_string * tty_prepare_flip_string_flags Signed-off-by: Jiri Slaby <jslaby@suse.cz> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:

committed by
Greg Kroah-Hartman

parent
227434f898
commit
2f69335710
@@ -705,7 +705,7 @@ static void ark3116_process_read_urb(struct urb *urb)
|
||||
if (lsr & UART_LSR_OE)
|
||||
tty_insert_flip_char(tty, 0, TTY_OVERRUN);
|
||||
}
|
||||
tty_insert_flip_string_fixed_flag(tty, data, tty_flag,
|
||||
tty_insert_flip_string_fixed_flag(&port->port, data, tty_flag,
|
||||
urb->actual_length);
|
||||
tty_flip_buffer_push(tty);
|
||||
tty_kref_put(tty);
|
||||
|
@@ -279,7 +279,7 @@ static void belkin_sa_process_read_urb(struct urb *urb)
|
||||
tty_insert_flip_char(tty, 0, TTY_OVERRUN);
|
||||
}
|
||||
|
||||
tty_insert_flip_string_fixed_flag(tty, data, tty_flag,
|
||||
tty_insert_flip_string_fixed_flag(&port->port, data, tty_flag,
|
||||
urb->actual_length);
|
||||
tty_flip_buffer_push(tty);
|
||||
tty_kref_put(tty);
|
||||
|
@@ -1215,7 +1215,7 @@ static void cypress_read_int_callback(struct urb *urb)
|
||||
|
||||
/* process read if there is data other than line status */
|
||||
if (tty && bytes > i) {
|
||||
tty_insert_flip_string_fixed_flag(tty, data + i,
|
||||
tty_insert_flip_string_fixed_flag(&port->port, data + i,
|
||||
tty_flag, bytes - i);
|
||||
tty_flip_buffer_push(tty);
|
||||
}
|
||||
|
@@ -1455,8 +1455,8 @@ static int digi_read_inb_callback(struct urb *urb)
|
||||
/* data length is len-1 (one byte of len is port_status) */
|
||||
--len;
|
||||
if (len > 0) {
|
||||
tty_insert_flip_string_fixed_flag(tty, data, flag,
|
||||
len);
|
||||
tty_insert_flip_string_fixed_flag(&port->port, data,
|
||||
flag, len);
|
||||
tty_flip_buffer_push(tty);
|
||||
}
|
||||
}
|
||||
|
@@ -140,7 +140,7 @@ static void f81232_process_read_urb(struct urb *urb)
|
||||
if (!usb_serial_handle_sysrq_char(port, data[i]))
|
||||
tty_insert_flip_char(tty, data[i], tty_flag);
|
||||
} else {
|
||||
tty_insert_flip_string_fixed_flag(tty, data, tty_flag,
|
||||
tty_insert_flip_string_fixed_flag(&port->port, data, tty_flag,
|
||||
urb->actual_length);
|
||||
}
|
||||
|
||||
|
@@ -2032,7 +2032,7 @@ static int ftdi_process_packet(struct tty_struct *tty,
|
||||
tty_insert_flip_char(tty, *ch, flag);
|
||||
}
|
||||
} else {
|
||||
tty_insert_flip_string_fixed_flag(tty, ch, flag, len);
|
||||
tty_insert_flip_string_fixed_flag(&port->port, ch, flag, len);
|
||||
}
|
||||
|
||||
return len;
|
||||
|
@@ -812,7 +812,7 @@ static void pl2303_process_read_urb(struct urb *urb)
|
||||
if (!usb_serial_handle_sysrq_char(port, data[i]))
|
||||
tty_insert_flip_char(tty, data[i], tty_flag);
|
||||
} else {
|
||||
tty_insert_flip_string_fixed_flag(tty, data, tty_flag,
|
||||
tty_insert_flip_string_fixed_flag(&port->port, data, tty_flag,
|
||||
urb->actual_length);
|
||||
}
|
||||
|
||||
|
@@ -505,7 +505,7 @@ static void spcp8x5_process_read_urb(struct urb *urb)
|
||||
priv->line_status & MSR_STATUS_LINE_DCD);
|
||||
}
|
||||
|
||||
tty_insert_flip_string_fixed_flag(tty, data, tty_flag,
|
||||
tty_insert_flip_string_fixed_flag(&port->port, data, tty_flag,
|
||||
urb->actual_length);
|
||||
tty_flip_buffer_push(tty);
|
||||
tty_kref_put(tty);
|
||||
|
@@ -617,7 +617,7 @@ static int ssu100_process_packet(struct urb *urb,
|
||||
tty_insert_flip_char(tty, *ch, flag);
|
||||
}
|
||||
} else
|
||||
tty_insert_flip_string_fixed_flag(tty, ch, flag, len);
|
||||
tty_insert_flip_string_fixed_flag(&port->port, ch, flag, len);
|
||||
|
||||
return len;
|
||||
}
|
||||
|
Reference in New Issue
Block a user