aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/core/sysfs.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/core/sysfs.c')
-rw-r--r--drivers/usb/core/sysfs.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/usb/core/sysfs.c b/drivers/usb/core/sysfs.c
index 1b3c00b3ca3f..d8f3bfe1559f 100644
--- a/drivers/usb/core/sysfs.c
+++ b/drivers/usb/core/sysfs.c
@@ -352,6 +352,7 @@ set_autosuspend(struct device *dev, struct device_attribute *attr,
352 return -EINVAL; 352 return -EINVAL;
353 value *= HZ; 353 value *= HZ;
354 354
355 usb_lock_device(udev);
355 udev->autosuspend_delay = value; 356 udev->autosuspend_delay = value;
356 if (value >= 0) 357 if (value >= 0)
357 usb_try_autosuspend_device(udev); 358 usb_try_autosuspend_device(udev);
@@ -359,6 +360,7 @@ set_autosuspend(struct device *dev, struct device_attribute *attr,
359 if (usb_autoresume_device(udev) == 0) 360 if (usb_autoresume_device(udev) == 0)
360 usb_autosuspend_device(udev); 361 usb_autosuspend_device(udev);
361 } 362 }
363 usb_unlock_device(udev);
362 return count; 364 return count;
363} 365}
364 366