aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
authorJason Wessel <jason.wessel@windriver.com>2010-03-08 22:50:12 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2010-05-20 16:21:31 -0400
commitbd5afa9eac6daa408412a31a6c69e87e8bd28c7e (patch)
tree5f99e4ee9d787d038746c2217f7c1152fad3c453 /drivers/usb
parent9757de384451a606af8c722213cb973192cbbd1b (diff)
usb-serial: Use tty_port version console instead of usb_serial_port
Replace all instances of using the console variable in struct usb_serial_port with the struct tty_port version. CC: Alan Cox <alan@linux.intel.com> CC: Alan Stern <stern@rowland.harvard.edu> CC: Oliver Neukum <oliver@neukum.org> CC: Andrew Morton <akpm@linux-foundation.org> CC: linux-usb@vger.kernel.org CC: linux-kernel@vger.kernel.org Signed-off-by: Jason Wessel <jason.wessel@windriver.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/serial/console.c5
-rw-r--r--drivers/usb/serial/ftdi_sio.c2
-rw-r--r--drivers/usb/serial/generic.c4
-rw-r--r--drivers/usb/serial/pl2303.c2
-rw-r--r--drivers/usb/serial/usb-serial.c4
5 files changed, 8 insertions, 9 deletions
diff --git a/drivers/usb/serial/console.c b/drivers/usb/serial/console.c
index f347da2ef00a..4ea64fef6718 100644
--- a/drivers/usb/serial/console.c
+++ b/drivers/usb/serial/console.c
@@ -180,7 +180,6 @@ static int usb_console_setup(struct console *co, char *options)
180 --port->port.count; 180 --port->port.count;
181 /* The console is special in terms of closing the device so 181 /* The console is special in terms of closing the device so
182 * indicate this port is now acting as a system console. */ 182 * indicate this port is now acting as a system console. */
183 port->console = 1;
184 port->port.console = 1; 183 port->port.console = 1;
185 184
186 mutex_unlock(&serial->disc_mutex); 185 mutex_unlock(&serial->disc_mutex);
@@ -217,7 +216,7 @@ static void usb_console_write(struct console *co,
217 216
218 dbg("%s - port %d, %d byte(s)", __func__, port->number, count); 217 dbg("%s - port %d, %d byte(s)", __func__, port->number, count);
219 218
220 if (!port->console) { 219 if (!port->port.console) {
221 dbg("%s - port not opened", __func__); 220 dbg("%s - port not opened", __func__);
222 return; 221 return;
223 } 222 }
@@ -313,7 +312,7 @@ void usb_serial_console_exit(void)
313{ 312{
314 if (usbcons_info.port) { 313 if (usbcons_info.port) {
315 unregister_console(&usbcons); 314 unregister_console(&usbcons);
316 usbcons_info.port->console = 0; 315 usbcons_info.port->port.console = 0;
317 usbcons_info.port = NULL; 316 usbcons_info.port = NULL;
318 } 317 }
319} 318}
diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c
index 1d7c4fac02e8..46a88ae9c46a 100644
--- a/drivers/usb/serial/ftdi_sio.c
+++ b/drivers/usb/serial/ftdi_sio.c
@@ -2074,7 +2074,7 @@ static int ftdi_process_packet(struct tty_struct *tty,
2074 return 0; /* status only */ 2074 return 0; /* status only */
2075 ch = packet + 2; 2075 ch = packet + 2;
2076 2076
2077 if (!(port->console && port->sysrq) && flag == TTY_NORMAL) 2077 if (!(port->port.console && port->sysrq) && flag == TTY_NORMAL)
2078 tty_insert_flip_string(tty, ch, len); 2078 tty_insert_flip_string(tty, ch, len);
2079 else { 2079 else {
2080 for (i = 0; i < len; i++, ch++) { 2080 for (i = 0; i < len; i++, ch++) {
diff --git a/drivers/usb/serial/generic.c b/drivers/usb/serial/generic.c
index f804acb138ec..ba61c745df0b 100644
--- a/drivers/usb/serial/generic.c
+++ b/drivers/usb/serial/generic.c
@@ -447,7 +447,7 @@ static void flush_and_resubmit_read_urb(struct usb_serial_port *port)
447 /* The per character mucking around with sysrq path it too slow for 447 /* The per character mucking around with sysrq path it too slow for
448 stuff like 3G modems, so shortcircuit it in the 99.9999999% of cases 448 stuff like 3G modems, so shortcircuit it in the 99.9999999% of cases
449 where the USB serial is not a console anyway */ 449 where the USB serial is not a console anyway */
450 if (!port->console || !port->sysrq) 450 if (!port->port.console || !port->sysrq)
451 tty_insert_flip_string(tty, ch, urb->actual_length); 451 tty_insert_flip_string(tty, ch, urb->actual_length);
452 else { 452 else {
453 /* Push data to tty */ 453 /* Push data to tty */
@@ -561,7 +561,7 @@ void usb_serial_generic_unthrottle(struct tty_struct *tty)
561int usb_serial_handle_sysrq_char(struct tty_struct *tty, 561int usb_serial_handle_sysrq_char(struct tty_struct *tty,
562 struct usb_serial_port *port, unsigned int ch) 562 struct usb_serial_port *port, unsigned int ch)
563{ 563{
564 if (port->sysrq && port->console) { 564 if (port->sysrq && port->port.console) {
565 if (ch && time_before(jiffies, port->sysrq)) { 565 if (ch && time_before(jiffies, port->sysrq)) {
566 handle_sysrq(ch, tty); 566 handle_sysrq(ch, tty);
567 port->sysrq = 0; 567 port->sysrq = 0;
diff --git a/drivers/usb/serial/pl2303.c b/drivers/usb/serial/pl2303.c
index c28b1607eacc..b10b0efe3e06 100644
--- a/drivers/usb/serial/pl2303.c
+++ b/drivers/usb/serial/pl2303.c
@@ -1058,7 +1058,7 @@ static void pl2303_push_data(struct tty_struct *tty,
1058 if (line_status & UART_OVERRUN_ERROR) 1058 if (line_status & UART_OVERRUN_ERROR)
1059 tty_insert_flip_char(tty, 0, TTY_OVERRUN); 1059 tty_insert_flip_char(tty, 0, TTY_OVERRUN);
1060 1060
1061 if (tty_flag == TTY_NORMAL && !(port->console && port->sysrq)) 1061 if (tty_flag == TTY_NORMAL && !(port->port.console && port->sysrq))
1062 tty_insert_flip_string(tty, data, urb->actual_length); 1062 tty_insert_flip_string(tty, data, urb->actual_length);
1063 else { 1063 else {
1064 int i; 1064 int i;
diff --git a/drivers/usb/serial/usb-serial.c b/drivers/usb/serial/usb-serial.c
index 3873660d8217..f3f65171de38 100644
--- a/drivers/usb/serial/usb-serial.c
+++ b/drivers/usb/serial/usb-serial.c
@@ -289,7 +289,7 @@ static void serial_down(struct tty_port *tport)
289 * The console is magical. Do not hang up the console hardware 289 * The console is magical. Do not hang up the console hardware
290 * or there will be tears. 290 * or there will be tears.
291 */ 291 */
292 if (port->console) 292 if (port->port.console)
293 return; 293 return;
294 if (drv->close) 294 if (drv->close)
295 drv->close(port); 295 drv->close(port);
@@ -328,7 +328,7 @@ static void serial_cleanup(struct tty_struct *tty)
328 /* The console is magical. Do not hang up the console hardware 328 /* The console is magical. Do not hang up the console hardware
329 * or there will be tears. 329 * or there will be tears.
330 */ 330 */
331 if (port->console) 331 if (port->port.console)
332 return; 332 return;
333 333
334 dbg("%s - port %d", __func__, port->number); 334 dbg("%s - port %d", __func__, port->number);