From: Alan Stern Date: Fri, 8 Jan 2010 17:56:42 +0000 (-0500) Subject: USB: use the device lock for persist_enabled X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=0c4db6df915bc470f0cd32fe48287fa6eb6adfb4;p=GitHub%2Fmt8127%2Fandroid_kernel_alcatel_ttab.git 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 Signed-off-by: Greg Kroah-Hartman --- 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, if (sscanf(buf, "%d", &value) != 1) return -EINVAL; - usb_pm_lock(udev); + + usb_lock_device(udev); udev->persist_enabled = !!value; - usb_pm_unlock(udev); + usb_unlock_device(udev); return count; }