Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 4627
b: refs/heads/master
c: 83ef344
h: refs/heads/master
i:
  4625: 17214dd
  4623: 8d98518
v: v3
  • Loading branch information
brian@murphy.dk authored and Greg Kroah-Hartman committed Jul 12, 2005
1 parent acdb239 commit 8fb009a
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 16 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: a3fdf4ebe016ba756de3ca29a2a6117e9acd721c
refs/heads/master: 83ef344a7539aa55a787790bc036f0bf3466e191
31 changes: 16 additions & 15 deletions trunk/drivers/usb/class/cdc-acm.c
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,17 @@ static int acm_tty_open(struct tty_struct *tty, struct file *filp)
return -EIO;
}

static void acm_tty_unregister(struct acm *acm)
{
tty_unregister_device(acm_tty_driver, acm->minor);
usb_put_intf(acm->control);
acm_table[acm->minor] = NULL;
usb_free_urb(acm->ctrlurb);
usb_free_urb(acm->readurb);
usb_free_urb(acm->writeurb);
kfree(acm);
}

static void acm_tty_close(struct tty_struct *tty, struct file *filp)
{
struct acm *acm = tty->driver_data;
Expand All @@ -436,14 +447,8 @@ static void acm_tty_close(struct tty_struct *tty, struct file *filp)
usb_kill_urb(acm->ctrlurb);
usb_kill_urb(acm->writeurb);
usb_kill_urb(acm->readurb);
} else {
tty_unregister_device(acm_tty_driver, acm->minor);
acm_table[acm->minor] = NULL;
usb_free_urb(acm->ctrlurb);
usb_free_urb(acm->readurb);
usb_free_urb(acm->writeurb);
kfree(acm);
}
} else
acm_tty_unregister(acm);
}
up(&open_sem);
}
Expand Down Expand Up @@ -905,7 +910,8 @@ static int acm_probe (struct usb_interface *intf,

usb_driver_claim_interface(&acm_driver, data_interface, acm);

tty_register_device(acm_tty_driver, minor, &intf->dev);
usb_get_intf(control_interface);
tty_register_device(acm_tty_driver, minor, &control_interface->dev);

acm_table[minor] = acm;
usb_set_intfdata (intf, acm);
Expand Down Expand Up @@ -954,12 +960,7 @@ static void acm_disconnect(struct usb_interface *intf)
usb_driver_release_interface(&acm_driver, acm->data);

if (!acm->used) {
tty_unregister_device(acm_tty_driver, acm->minor);
acm_table[acm->minor] = NULL;
usb_free_urb(acm->ctrlurb);
usb_free_urb(acm->readurb);
usb_free_urb(acm->writeurb);
kfree(acm);
acm_tty_unregister(acm);
up(&open_sem);
return;
}
Expand Down

0 comments on commit 8fb009a

Please sign in to comment.