usb-serial: rename subroutines

This patch (as1289) renames serial_do_down() to serial_down() and
serial_do_free() to serial_release().  It also adds a missing call to
tty_shutdown() in serial_release().

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
Alan Stern 2009-09-01 11:39:40 -04:00 committed by Live-CD User
parent 7e29bb4b77
commit 74556123e0
1 changed files with 11 additions and 8 deletions

View File

@ -191,7 +191,7 @@ void usb_serial_put(struct usb_serial *serial)
* This is the first place a new tty gets used. Hence this is where we * This is the first place a new tty gets used. Hence this is where we
* acquire references to the usb_serial structure and the driver module, * acquire references to the usb_serial structure and the driver module,
* where we store a pointer to the port, and where we do an autoresume. * where we store a pointer to the port, and where we do an autoresume.
* All these actions are reversed in serial_do_free(). * All these actions are reversed in serial_release().
*/ */
static int serial_install(struct tty_driver *driver, struct tty_struct *tty) static int serial_install(struct tty_driver *driver, struct tty_struct *tty)
{ {
@ -296,13 +296,13 @@ static int serial_open (struct tty_struct *tty, struct file *filp)
} }
/** /**
* serial_do_down - shut down hardware * serial_down - shut down hardware
* @port: port to shut down * @port: port to shut down
* *
* Shut down a USB serial port unless it is the console. We never * Shut down a USB serial port unless it is the console. We never
* shut down the console hardware as it will always be in use. * shut down the console hardware as it will always be in use.
*/ */
static void serial_do_down(struct usb_serial_port *port) static void serial_down(struct usb_serial_port *port)
{ {
struct usb_serial_driver *drv = port->serial->type; struct usb_serial_driver *drv = port->serial->type;
struct usb_serial *serial; struct usb_serial *serial;
@ -328,7 +328,7 @@ static void serial_do_down(struct usb_serial_port *port)
static void serial_hangup(struct tty_struct *tty) static void serial_hangup(struct tty_struct *tty)
{ {
struct usb_serial_port *port = tty->driver_data; struct usb_serial_port *port = tty->driver_data;
serial_do_down(port); serial_down(port);
tty_port_hangup(&port->port); tty_port_hangup(&port->port);
/* We must not free port yet - the USB serial layer depends on it's /* We must not free port yet - the USB serial layer depends on it's
continued existence */ continued existence */
@ -342,13 +342,13 @@ static void serial_close(struct tty_struct *tty, struct file *filp)
if (tty_port_close_start(&port->port, tty, filp) == 0) if (tty_port_close_start(&port->port, tty, filp) == 0)
return; return;
serial_do_down(port); serial_down(port);
tty_port_close_end(&port->port, tty); tty_port_close_end(&port->port, tty);
tty_port_tty_set(&port->port, NULL); tty_port_tty_set(&port->port, NULL);
} }
/** /**
* serial_do_free - free resources post close/hangup * serial_release - free resources post close/hangup
* @port: port to free up * @port: port to free up
* *
* Do the resource freeing and refcount dropping for the port. * Do the resource freeing and refcount dropping for the port.
@ -356,7 +356,7 @@ static void serial_close(struct tty_struct *tty, struct file *filp)
* *
* Called when the last tty kref is dropped. * Called when the last tty kref is dropped.
*/ */
static void serial_do_free(struct tty_struct *tty) static void serial_release(struct tty_struct *tty)
{ {
struct usb_serial_port *port = tty->driver_data; struct usb_serial_port *port = tty->driver_data;
struct usb_serial *serial; struct usb_serial *serial;
@ -368,6 +368,9 @@ static void serial_do_free(struct tty_struct *tty)
if (port->console) if (port->console)
return; return;
/* Standard shutdown processing */
tty_shutdown(tty);
tty->driver_data = NULL; tty->driver_data = NULL;
serial = port->serial; serial = port->serial;
@ -1204,7 +1207,7 @@ static const struct tty_operations serial_ops = {
.chars_in_buffer = serial_chars_in_buffer, .chars_in_buffer = serial_chars_in_buffer,
.tiocmget = serial_tiocmget, .tiocmget = serial_tiocmget,
.tiocmset = serial_tiocmset, .tiocmset = serial_tiocmset,
.shutdown = serial_do_free, .shutdown = serial_release,
.install = serial_install, .install = serial_install,
.proc_fops = &serial_proc_fops, .proc_fops = &serial_proc_fops,
}; };