diff options
| author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2009-12-02 23:38:13 -0800 | 
|---|---|---|
| committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2009-12-02 23:38:13 -0800 | 
| commit | 467832032cc07626880363efa8625719c16c04eb (patch) | |
| tree | ee9a62c04f0b3106e412bc1b2dd1cea5566d5ca7 /drivers/usb/class/cdc-acm.c | |
| parent | 66d2a5952eab875f1286e04f738ef029afdaf013 (diff) | |
| parent | 22763c5cf3690a681551162c15d34d935308c8d7 (diff) | |
Merge commit 'v2.6.32' into next
Diffstat (limited to 'drivers/usb/class/cdc-acm.c')
| -rw-r--r-- | drivers/usb/class/cdc-acm.c | 18 | 
1 files changed, 12 insertions, 6 deletions
diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c index e3861b21e776..e4eca7810bcf 100644 --- a/drivers/usb/class/cdc-acm.c +++ b/drivers/usb/class/cdc-acm.c @@ -609,9 +609,9 @@ static int acm_tty_open(struct tty_struct *tty, struct file *filp)  	acm->throttle = 0; -	tasklet_schedule(&acm->urb_task);  	set_bit(ASYNCB_INITIALIZED, &acm->port.flags);  	rv = tty_port_block_til_ready(&acm->port, tty, filp); +	tasklet_schedule(&acm->urb_task);  done:  	mutex_unlock(&acm->mutex);  err_out: @@ -686,15 +686,21 @@ static void acm_tty_close(struct tty_struct *tty, struct file *filp)  	/* Perform the closing process and see if we need to do the hardware  	   shutdown */ -	if (!acm || tty_port_close_start(&acm->port, tty, filp) == 0) +	if (!acm) +		return; +	if (tty_port_close_start(&acm->port, tty, filp) == 0) { +		mutex_lock(&open_mutex); +		if (!acm->dev) { +			tty_port_tty_set(&acm->port, NULL); +			acm_tty_unregister(acm); +			tty->driver_data = NULL; +		} +		mutex_unlock(&open_mutex);  		return; +	}  	acm_port_down(acm, 0);  	tty_port_close_end(&acm->port, tty); -	mutex_lock(&open_mutex);  	tty_port_tty_set(&acm->port, NULL); -	if (!acm->dev) -		acm_tty_unregister(acm); -	mutex_unlock(&open_mutex);  }  static int acm_tty_write(struct tty_struct *tty,  | 
