Commit 0c4db6df authored by Alan Stern's avatar Alan Stern Committed by Greg Kroah-Hartman

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: default avatarAlan Stern <stern@rowland.harvard.edu>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 0534d468
......@@ -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;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment