diff options
Diffstat (limited to 'drivers/usb/class')
-rw-r--r-- | drivers/usb/class/cdc-acm.c | 2 | ||||
-rw-r--r-- | drivers/usb/class/cdc-wdm.c | 3 | ||||
-rw-r--r-- | drivers/usb/class/usbtmc.c | 9 |
3 files changed, 6 insertions, 8 deletions
diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c index d50a99f70aee..00b47ea24f86 100644 --- a/drivers/usb/class/cdc-acm.c +++ b/drivers/usb/class/cdc-acm.c | |||
@@ -1275,7 +1275,7 @@ static int acm_suspend(struct usb_interface *intf, pm_message_t message) | |||
1275 | struct acm *acm = usb_get_intfdata(intf); | 1275 | struct acm *acm = usb_get_intfdata(intf); |
1276 | int cnt; | 1276 | int cnt; |
1277 | 1277 | ||
1278 | if (acm->dev->auto_pm) { | 1278 | if (message.event & PM_EVENT_AUTO) { |
1279 | int b; | 1279 | int b; |
1280 | 1280 | ||
1281 | spin_lock_irq(&acm->read_lock); | 1281 | spin_lock_irq(&acm->read_lock); |
diff --git a/drivers/usb/class/cdc-wdm.c b/drivers/usb/class/cdc-wdm.c index 5a8ecc045e3f..3771d6e6d0cc 100644 --- a/drivers/usb/class/cdc-wdm.c +++ b/drivers/usb/class/cdc-wdm.c | |||
@@ -764,7 +764,8 @@ static int wdm_suspend(struct usb_interface *intf, pm_message_t message) | |||
764 | 764 | ||
765 | mutex_lock(&desc->plock); | 765 | mutex_lock(&desc->plock); |
766 | #ifdef CONFIG_PM | 766 | #ifdef CONFIG_PM |
767 | if (interface_to_usbdev(desc->intf)->auto_pm && test_bit(WDM_IN_USE, &desc->flags)) { | 767 | if ((message.event & PM_EVENT_AUTO) && |
768 | test_bit(WDM_IN_USE, &desc->flags)) { | ||
768 | rv = -EBUSY; | 769 | rv = -EBUSY; |
769 | } else { | 770 | } else { |
770 | #endif | 771 | #endif |
diff --git a/drivers/usb/class/usbtmc.c b/drivers/usb/class/usbtmc.c index 43a863c5cc43..0f5c05f6f9df 100644 --- a/drivers/usb/class/usbtmc.c +++ b/drivers/usb/class/usbtmc.c | |||
@@ -21,6 +21,7 @@ | |||
21 | 21 | ||
22 | #include <linux/init.h> | 22 | #include <linux/init.h> |
23 | #include <linux/module.h> | 23 | #include <linux/module.h> |
24 | #include <linux/kernel.h> | ||
24 | #include <linux/fs.h> | 25 | #include <linux/fs.h> |
25 | #include <linux/uaccess.h> | 26 | #include <linux/uaccess.h> |
26 | #include <linux/kref.h> | 27 | #include <linux/kref.h> |
@@ -482,7 +483,6 @@ static ssize_t usbtmc_write(struct file *filp, const char __user *buf, | |||
482 | int retval; | 483 | int retval; |
483 | int actual; | 484 | int actual; |
484 | unsigned long int n_bytes; | 485 | unsigned long int n_bytes; |
485 | int n; | ||
486 | int remaining; | 486 | int remaining; |
487 | int done; | 487 | int done; |
488 | int this_part; | 488 | int this_part; |
@@ -526,11 +526,8 @@ static ssize_t usbtmc_write(struct file *filp, const char __user *buf, | |||
526 | goto exit; | 526 | goto exit; |
527 | } | 527 | } |
528 | 528 | ||
529 | n_bytes = 12 + this_part; | 529 | n_bytes = roundup(12 + this_part, 4); |
530 | if (this_part % 4) | 530 | memset(buffer + 12 + this_part, 0, n_bytes - (12 + this_part)); |
531 | n_bytes += 4 - this_part % 4; | ||
532 | for (n = 12 + this_part; n < n_bytes; n++) | ||
533 | buffer[n] = 0; | ||
534 | 531 | ||
535 | retval = usb_bulk_msg(data->usb_dev, | 532 | retval = usb_bulk_msg(data->usb_dev, |
536 | usb_sndbulkpipe(data->usb_dev, | 533 | usb_sndbulkpipe(data->usb_dev, |