提交 bd5afa9e 编写于 作者: J Jason Wessel 提交者: Greg Kroah-Hartman

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: NJason Wessel <jason.wessel@windriver.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 9757de38
...@@ -180,7 +180,6 @@ static int usb_console_setup(struct console *co, char *options) ...@@ -180,7 +180,6 @@ static int usb_console_setup(struct console *co, char *options)
--port->port.count; --port->port.count;
/* The console is special in terms of closing the device so /* The console is special in terms of closing the device so
* indicate this port is now acting as a system console. */ * indicate this port is now acting as a system console. */
port->console = 1;
port->port.console = 1; port->port.console = 1;
mutex_unlock(&serial->disc_mutex); mutex_unlock(&serial->disc_mutex);
...@@ -217,7 +216,7 @@ static void usb_console_write(struct console *co, ...@@ -217,7 +216,7 @@ static void usb_console_write(struct console *co,
dbg("%s - port %d, %d byte(s)", __func__, port->number, count); dbg("%s - port %d, %d byte(s)", __func__, port->number, count);
if (!port->console) { if (!port->port.console) {
dbg("%s - port not opened", __func__); dbg("%s - port not opened", __func__);
return; return;
} }
...@@ -313,7 +312,7 @@ void usb_serial_console_exit(void) ...@@ -313,7 +312,7 @@ void usb_serial_console_exit(void)
{ {
if (usbcons_info.port) { if (usbcons_info.port) {
unregister_console(&usbcons); unregister_console(&usbcons);
usbcons_info.port->console = 0; usbcons_info.port->port.console = 0;
usbcons_info.port = NULL; usbcons_info.port = NULL;
} }
} }
......
...@@ -2074,7 +2074,7 @@ static int ftdi_process_packet(struct tty_struct *tty, ...@@ -2074,7 +2074,7 @@ static int ftdi_process_packet(struct tty_struct *tty,
return 0; /* status only */ return 0; /* status only */
ch = packet + 2; ch = packet + 2;
if (!(port->console && port->sysrq) && flag == TTY_NORMAL) if (!(port->port.console && port->sysrq) && flag == TTY_NORMAL)
tty_insert_flip_string(tty, ch, len); tty_insert_flip_string(tty, ch, len);
else { else {
for (i = 0; i < len; i++, ch++) { for (i = 0; i < len; i++, ch++) {
......
...@@ -447,7 +447,7 @@ static void flush_and_resubmit_read_urb(struct usb_serial_port *port) ...@@ -447,7 +447,7 @@ static void flush_and_resubmit_read_urb(struct usb_serial_port *port)
/* The per character mucking around with sysrq path it too slow for /* The per character mucking around with sysrq path it too slow for
stuff like 3G modems, so shortcircuit it in the 99.9999999% of cases stuff like 3G modems, so shortcircuit it in the 99.9999999% of cases
where the USB serial is not a console anyway */ where the USB serial is not a console anyway */
if (!port->console || !port->sysrq) if (!port->port.console || !port->sysrq)
tty_insert_flip_string(tty, ch, urb->actual_length); tty_insert_flip_string(tty, ch, urb->actual_length);
else { else {
/* Push data to tty */ /* Push data to tty */
...@@ -561,7 +561,7 @@ void usb_serial_generic_unthrottle(struct tty_struct *tty) ...@@ -561,7 +561,7 @@ void usb_serial_generic_unthrottle(struct tty_struct *tty)
int usb_serial_handle_sysrq_char(struct tty_struct *tty, int usb_serial_handle_sysrq_char(struct tty_struct *tty,
struct usb_serial_port *port, unsigned int ch) struct usb_serial_port *port, unsigned int ch)
{ {
if (port->sysrq && port->console) { if (port->sysrq && port->port.console) {
if (ch && time_before(jiffies, port->sysrq)) { if (ch && time_before(jiffies, port->sysrq)) {
handle_sysrq(ch, tty); handle_sysrq(ch, tty);
port->sysrq = 0; port->sysrq = 0;
......
...@@ -1058,7 +1058,7 @@ static void pl2303_push_data(struct tty_struct *tty, ...@@ -1058,7 +1058,7 @@ static void pl2303_push_data(struct tty_struct *tty,
if (line_status & UART_OVERRUN_ERROR) if (line_status & UART_OVERRUN_ERROR)
tty_insert_flip_char(tty, 0, TTY_OVERRUN); tty_insert_flip_char(tty, 0, TTY_OVERRUN);
if (tty_flag == TTY_NORMAL && !(port->console && port->sysrq)) if (tty_flag == TTY_NORMAL && !(port->port.console && port->sysrq))
tty_insert_flip_string(tty, data, urb->actual_length); tty_insert_flip_string(tty, data, urb->actual_length);
else { else {
int i; int i;
......
...@@ -289,7 +289,7 @@ static void serial_down(struct tty_port *tport) ...@@ -289,7 +289,7 @@ static void serial_down(struct tty_port *tport)
* The console is magical. Do not hang up the console hardware * The console is magical. Do not hang up the console hardware
* or there will be tears. * or there will be tears.
*/ */
if (port->console) if (port->port.console)
return; return;
if (drv->close) if (drv->close)
drv->close(port); drv->close(port);
...@@ -328,7 +328,7 @@ static void serial_cleanup(struct tty_struct *tty) ...@@ -328,7 +328,7 @@ static void serial_cleanup(struct tty_struct *tty)
/* The console is magical. Do not hang up the console hardware /* The console is magical. Do not hang up the console hardware
* or there will be tears. * or there will be tears.
*/ */
if (port->console) if (port->port.console)
return; return;
dbg("%s - port %d", __func__, port->number); dbg("%s - port %d", __func__, port->number);
......
...@@ -66,7 +66,6 @@ enum port_dev_state { ...@@ -66,7 +66,6 @@ enum port_dev_state {
* @work: work queue entry for the line discipline waking up. * @work: work queue entry for the line discipline waking up.
* @throttled: nonzero if the read urb is inactive to throttle the device * @throttled: nonzero if the read urb is inactive to throttle the device
* @throttle_req: nonzero if the tty wants to throttle us * @throttle_req: nonzero if the tty wants to throttle us
* @console: attached usb serial console
* @dev: pointer to the serial device * @dev: pointer to the serial device
* *
* This structure is used by the usb-serial core and drivers for the specific * This structure is used by the usb-serial core and drivers for the specific
...@@ -106,7 +105,6 @@ struct usb_serial_port { ...@@ -106,7 +105,6 @@ struct usb_serial_port {
struct work_struct work; struct work_struct work;
char throttled; char throttled;
char throttle_req; char throttle_req;
char console;
unsigned long sysrq; /* sysrq timeout */ unsigned long sysrq; /* sysrq timeout */
struct device dev; struct device dev;
enum port_dev_state dev_state; enum port_dev_state dev_state;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册