When this setting is changed it may require the parent port to keep
power on, or allow it to turn power off.  In any event we want
pm_runtime to re-evaluate.

Signed-off-by: Dan Williams <[email protected]>
---
 drivers/usb/core/sysfs.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/drivers/usb/core/sysfs.c b/drivers/usb/core/sysfs.c
index 52a97adf02a0..743248da1ec3 100644
--- a/drivers/usb/core/sysfs.c
+++ b/drivers/usb/core/sysfs.c
@@ -303,9 +303,12 @@ static ssize_t persist_store(struct device *dev, struct 
device_attribute *attr,
        if (sscanf(buf, "%d", &value) != 1)
                return -EINVAL;
 
+       pm_runtime_get_sync(dev);
        usb_lock_device(udev);
        udev->persist_enabled = !!value;
        usb_unlock_device(udev);
+       pm_runtime_put_sync(dev);
+
        return count;
 }
 static DEVICE_ATTR_RW(persist);

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to