aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/core/sysfs.c
diff options
context:
space:
mode:
authorAlan Stern <stern@rowland.harvard.edu>2010-01-08 12:56:42 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2010-03-02 17:54:08 -0500
commit0c4db6df915bc470f0cd32fe48287fa6eb6adfb4 (patch)
tree5a6d1a782c63b0f9ef0070422babdadec48a18bd /drivers/usb/core/sysfs.c
parent0534d46848990e8eed7cd0832d745d813e827261 (diff)
USB: use the device lock for persist_enabled
This patch (as1325) changes the locking for the persist_enabled flag in struct usb_device. Now it is protected by the device lock, along with all its neighboring bit flags, instead of the PM lock (which is about to vanish anyway). Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/core/sysfs.c')
-rw-r--r--drivers/usb/core/sysfs.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/usb/core/sysfs.c b/drivers/usb/core/sysfs.c
index d8f3bfe1559f..5a1a0e2b6474 100644
--- a/drivers/usb/core/sysfs.c
+++ b/drivers/usb/core/sysfs.c
@@ -256,9 +256,10 @@ set_persist(struct device *dev, struct device_attribute *attr,
256 256
257 if (sscanf(buf, "%d", &value) != 1) 257 if (sscanf(buf, "%d", &value) != 1)
258 return -EINVAL; 258 return -EINVAL;
259 usb_pm_lock(udev); 259
260 usb_lock_device(udev);
260 udev->persist_enabled = !!value; 261 udev->persist_enabled = !!value;
261 usb_pm_unlock(udev); 262 usb_unlock_device(udev);
262 return count; 263 return count;
263} 264}
264 265