Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 163874
b: refs/heads/master
c: 7455612
h: refs/heads/master
v: v3
  • Loading branch information
Alan Stern authored and Live-CD User committed Sep 19, 2009
1 parent c79627f commit 4c7610c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 7e29bb4b779f4f35385e6f21994758845bf14d23
refs/heads/master: 74556123e034c8337b69a3ebac2f3a5fc0a97032
19 changes: 11 additions & 8 deletions trunk/drivers/usb/serial/usb-serial.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
* 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.
* 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)
{
Expand Down Expand Up @@ -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
*
* 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.
*/
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 *serial;
Expand All @@ -328,7 +328,7 @@ static void serial_do_down(struct usb_serial_port *port)
static void serial_hangup(struct tty_struct *tty)
{
struct usb_serial_port *port = tty->driver_data;
serial_do_down(port);
serial_down(port);
tty_port_hangup(&port->port);
/* We must not free port yet - the USB serial layer depends on it's
continued existence */
Expand All @@ -342,21 +342,21 @@ static void serial_close(struct tty_struct *tty, struct file *filp)

if (tty_port_close_start(&port->port, tty, filp) == 0)
return;
serial_do_down(port);
serial_down(port);
tty_port_close_end(&port->port, tty);
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
*
* Do the resource freeing and refcount dropping for the port.
* Avoid freeing the console.
*
* 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 *serial;
Expand All @@ -368,6 +368,9 @@ static void serial_do_free(struct tty_struct *tty)
if (port->console)
return;

/* Standard shutdown processing */
tty_shutdown(tty);

tty->driver_data = NULL;

serial = port->serial;
Expand Down Expand Up @@ -1204,7 +1207,7 @@ static const struct tty_operations serial_ops = {
.chars_in_buffer = serial_chars_in_buffer,
.tiocmget = serial_tiocmget,
.tiocmset = serial_tiocmset,
.shutdown = serial_do_free,
.shutdown = serial_release,
.install = serial_install,
.proc_fops = &serial_proc_fops,
};
Expand Down

0 comments on commit 4c7610c

Please sign in to comment.