Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 275822
b: refs/heads/master
c: 5dc2470
h: refs/heads/master
v: v3
  • Loading branch information
Havard Skinnemoen authored and Greg Kroah-Hartman committed Nov 14, 2011
1 parent de924c1 commit 4022893
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 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: 60c71ca972a2dd3fd9d0165b405361c8ad48349b
refs/heads/master: 5dc2470c602da8851907ec18942cd876c3b4ecc1
8 changes: 5 additions & 3 deletions trunk/drivers/usb/class/cdc-acm.c
Original file line number Diff line number Diff line change
Expand Up @@ -539,7 +539,6 @@ static void acm_port_down(struct acm *acm)
{
int i;

mutex_lock(&open_mutex);
if (acm->dev) {
usb_autopm_get_interface(acm->control);
acm_set_control(acm, acm->ctrlout = 0);
Expand All @@ -551,14 +550,15 @@ static void acm_port_down(struct acm *acm)
acm->control->needs_remote_wakeup = 0;
usb_autopm_put_interface(acm->control);
}
mutex_unlock(&open_mutex);
}

static void acm_tty_hangup(struct tty_struct *tty)
{
struct acm *acm = tty->driver_data;
tty_port_hangup(&acm->port);
mutex_lock(&open_mutex);
acm_port_down(acm);
mutex_unlock(&open_mutex);
}

static void acm_tty_close(struct tty_struct *tty, struct file *filp)
Expand All @@ -569,8 +569,9 @@ static void acm_tty_close(struct tty_struct *tty, struct file *filp)
shutdown */
if (!acm)
return;

mutex_lock(&open_mutex);
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);
Expand All @@ -582,6 +583,7 @@ static void acm_tty_close(struct tty_struct *tty, struct file *filp)
acm_port_down(acm);
tty_port_close_end(&acm->port, tty);
tty_port_tty_set(&acm->port, NULL);
mutex_unlock(&open_mutex);
}

static int acm_tty_write(struct tty_struct *tty,
Expand Down

0 comments on commit 4022893

Please sign in to comment.