diff options
Diffstat (limited to 'drivers/usb/class')
-rw-r--r-- | drivers/usb/class/cdc-acm.c | 18 | ||||
-rw-r--r-- | drivers/usb/class/usbtmc.c | 4 |
2 files changed, 14 insertions, 8 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) | |||
609 | 609 | ||
610 | acm->throttle = 0; | 610 | acm->throttle = 0; |
611 | 611 | ||
612 | tasklet_schedule(&acm->urb_task); | ||
613 | set_bit(ASYNCB_INITIALIZED, &acm->port.flags); | 612 | set_bit(ASYNCB_INITIALIZED, &acm->port.flags); |
614 | rv = tty_port_block_til_ready(&acm->port, tty, filp); | 613 | rv = tty_port_block_til_ready(&acm->port, tty, filp); |
614 | tasklet_schedule(&acm->urb_task); | ||
615 | done: | 615 | done: |
616 | mutex_unlock(&acm->mutex); | 616 | mutex_unlock(&acm->mutex); |
617 | err_out: | 617 | err_out: |
@@ -686,15 +686,21 @@ static void acm_tty_close(struct tty_struct *tty, struct file *filp) | |||
686 | 686 | ||
687 | /* Perform the closing process and see if we need to do the hardware | 687 | /* Perform the closing process and see if we need to do the hardware |
688 | shutdown */ | 688 | shutdown */ |
689 | if (!acm || tty_port_close_start(&acm->port, tty, filp) == 0) | 689 | if (!acm) |
690 | return; | ||
691 | if (tty_port_close_start(&acm->port, tty, filp) == 0) { | ||
692 | mutex_lock(&open_mutex); | ||
693 | if (!acm->dev) { | ||
694 | tty_port_tty_set(&acm->port, NULL); | ||
695 | acm_tty_unregister(acm); | ||
696 | tty->driver_data = NULL; | ||
697 | } | ||
698 | mutex_unlock(&open_mutex); | ||
690 | return; | 699 | return; |
700 | } | ||
691 | acm_port_down(acm, 0); | 701 | acm_port_down(acm, 0); |
692 | tty_port_close_end(&acm->port, tty); | 702 | tty_port_close_end(&acm->port, tty); |
693 | mutex_lock(&open_mutex); | ||
694 | tty_port_tty_set(&acm->port, NULL); | 703 | tty_port_tty_set(&acm->port, NULL); |
695 | if (!acm->dev) | ||
696 | acm_tty_unregister(acm); | ||
697 | mutex_unlock(&open_mutex); | ||
698 | } | 704 | } |
699 | 705 | ||
700 | static int acm_tty_write(struct tty_struct *tty, | 706 | static int acm_tty_write(struct tty_struct *tty, |
diff --git a/drivers/usb/class/usbtmc.c b/drivers/usb/class/usbtmc.c index 333ee02e7b2b..2473cf0c6b1d 100644 --- a/drivers/usb/class/usbtmc.c +++ b/drivers/usb/class/usbtmc.c | |||
@@ -39,7 +39,7 @@ | |||
39 | #define USBTMC_SIZE_IOBUFFER 2048 | 39 | #define USBTMC_SIZE_IOBUFFER 2048 |
40 | 40 | ||
41 | /* Default USB timeout (in milliseconds) */ | 41 | /* Default USB timeout (in milliseconds) */ |
42 | #define USBTMC_TIMEOUT 10 | 42 | #define USBTMC_TIMEOUT 5000 |
43 | 43 | ||
44 | /* | 44 | /* |
45 | * Maximum number of read cycles to empty bulk in endpoint during CLEAR and | 45 | * Maximum number of read cycles to empty bulk in endpoint during CLEAR and |
@@ -993,7 +993,7 @@ skip_io_on_zombie: | |||
993 | return retval; | 993 | return retval; |
994 | } | 994 | } |
995 | 995 | ||
996 | static struct file_operations fops = { | 996 | static const struct file_operations fops = { |
997 | .owner = THIS_MODULE, | 997 | .owner = THIS_MODULE, |
998 | .read = usbtmc_read, | 998 | .read = usbtmc_read, |
999 | .write = usbtmc_write, | 999 | .write = usbtmc_write, |