diff options
Diffstat (limited to 'drivers/usb/class/cdc-acm.c')
-rw-r--r-- | drivers/usb/class/cdc-acm.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c index dac7676ce21b..e8c564a53346 100644 --- a/drivers/usb/class/cdc-acm.c +++ b/drivers/usb/class/cdc-acm.c | |||
@@ -539,7 +539,6 @@ static void acm_port_down(struct acm *acm) | |||
539 | { | 539 | { |
540 | int i; | 540 | int i; |
541 | 541 | ||
542 | mutex_lock(&open_mutex); | ||
543 | if (acm->dev) { | 542 | if (acm->dev) { |
544 | usb_autopm_get_interface(acm->control); | 543 | usb_autopm_get_interface(acm->control); |
545 | acm_set_control(acm, acm->ctrlout = 0); | 544 | acm_set_control(acm, acm->ctrlout = 0); |
@@ -551,14 +550,15 @@ static void acm_port_down(struct acm *acm) | |||
551 | acm->control->needs_remote_wakeup = 0; | 550 | acm->control->needs_remote_wakeup = 0; |
552 | usb_autopm_put_interface(acm->control); | 551 | usb_autopm_put_interface(acm->control); |
553 | } | 552 | } |
554 | mutex_unlock(&open_mutex); | ||
555 | } | 553 | } |
556 | 554 | ||
557 | static void acm_tty_hangup(struct tty_struct *tty) | 555 | static void acm_tty_hangup(struct tty_struct *tty) |
558 | { | 556 | { |
559 | struct acm *acm = tty->driver_data; | 557 | struct acm *acm = tty->driver_data; |
560 | tty_port_hangup(&acm->port); | 558 | tty_port_hangup(&acm->port); |
559 | mutex_lock(&open_mutex); | ||
561 | acm_port_down(acm); | 560 | acm_port_down(acm); |
561 | mutex_unlock(&open_mutex); | ||
562 | } | 562 | } |
563 | 563 | ||
564 | static void acm_tty_close(struct tty_struct *tty, struct file *filp) | 564 | static void acm_tty_close(struct tty_struct *tty, struct file *filp) |
@@ -569,8 +569,9 @@ static void acm_tty_close(struct tty_struct *tty, struct file *filp) | |||
569 | shutdown */ | 569 | shutdown */ |
570 | if (!acm) | 570 | if (!acm) |
571 | return; | 571 | return; |
572 | |||
573 | mutex_lock(&open_mutex); | ||
572 | if (tty_port_close_start(&acm->port, tty, filp) == 0) { | 574 | if (tty_port_close_start(&acm->port, tty, filp) == 0) { |
573 | mutex_lock(&open_mutex); | ||
574 | if (!acm->dev) { | 575 | if (!acm->dev) { |
575 | tty_port_tty_set(&acm->port, NULL); | 576 | tty_port_tty_set(&acm->port, NULL); |
576 | acm_tty_unregister(acm); | 577 | acm_tty_unregister(acm); |
@@ -582,6 +583,7 @@ static void acm_tty_close(struct tty_struct *tty, struct file *filp) | |||
582 | acm_port_down(acm); | 583 | acm_port_down(acm); |
583 | tty_port_close_end(&acm->port, tty); | 584 | tty_port_close_end(&acm->port, tty); |
584 | tty_port_tty_set(&acm->port, NULL); | 585 | tty_port_tty_set(&acm->port, NULL); |
586 | mutex_unlock(&open_mutex); | ||
585 | } | 587 | } |
586 | 588 | ||
587 | static int acm_tty_write(struct tty_struct *tty, | 589 | static int acm_tty_write(struct tty_struct *tty, |
@@ -1058,11 +1060,11 @@ made_compressed_probe: | |||
1058 | goto alloc_fail; | 1060 | goto alloc_fail; |
1059 | } | 1061 | } |
1060 | 1062 | ||
1061 | ctrlsize = le16_to_cpu(epctrl->wMaxPacketSize); | 1063 | ctrlsize = usb_endpoint_maxp(epctrl); |
1062 | readsize = le16_to_cpu(epread->wMaxPacketSize) * | 1064 | readsize = usb_endpoint_maxp(epread) * |
1063 | (quirks == SINGLE_RX_URB ? 1 : 2); | 1065 | (quirks == SINGLE_RX_URB ? 1 : 2); |
1064 | acm->combined_interfaces = combined_interfaces; | 1066 | acm->combined_interfaces = combined_interfaces; |
1065 | acm->writesize = le16_to_cpu(epwrite->wMaxPacketSize) * 20; | 1067 | acm->writesize = usb_endpoint_maxp(epwrite) * 20; |
1066 | acm->control = control_interface; | 1068 | acm->control = control_interface; |
1067 | acm->data = data_interface; | 1069 | acm->data = data_interface; |
1068 | acm->minor = minor; | 1070 | acm->minor = minor; |
@@ -1305,7 +1307,7 @@ static int acm_suspend(struct usb_interface *intf, pm_message_t message) | |||
1305 | struct acm *acm = usb_get_intfdata(intf); | 1307 | struct acm *acm = usb_get_intfdata(intf); |
1306 | int cnt; | 1308 | int cnt; |
1307 | 1309 | ||
1308 | if (message.event & PM_EVENT_AUTO) { | 1310 | if (PMSG_IS_AUTO(message)) { |
1309 | int b; | 1311 | int b; |
1310 | 1312 | ||
1311 | spin_lock_irq(&acm->write_lock); | 1313 | spin_lock_irq(&acm->write_lock); |
@@ -1534,6 +1536,9 @@ static const struct usb_device_id acm_ids[] = { | |||
1534 | { NOKIA_PCSUITE_ACM_INFO(0x03cd), }, /* Nokia C7 */ | 1536 | { NOKIA_PCSUITE_ACM_INFO(0x03cd), }, /* Nokia C7 */ |
1535 | { SAMSUNG_PCSUITE_ACM_INFO(0x6651), }, /* Samsung GTi8510 (INNOV8) */ | 1537 | { SAMSUNG_PCSUITE_ACM_INFO(0x6651), }, /* Samsung GTi8510 (INNOV8) */ |
1536 | 1538 | ||
1539 | /* Support for Owen devices */ | ||
1540 | { USB_DEVICE(0x03eb, 0x0030), }, /* Owen SI30 */ | ||
1541 | |||
1537 | /* NOTE: non-Nokia COMM/ACM/0xff is likely MSFT RNDIS... NOT a modem! */ | 1542 | /* NOTE: non-Nokia COMM/ACM/0xff is likely MSFT RNDIS... NOT a modem! */ |
1538 | 1543 | ||
1539 | /* Support Lego NXT using pbLua firmware */ | 1544 | /* Support Lego NXT using pbLua firmware */ |