• Alan Stern's avatar
    USB: change handling of negative autosuspend delays · 5899f1e0
    Alan Stern authored
    This patch (as1327) changes the way negative autosuspend delays
    prevent device from autosuspending.  The current code checks for
    negative values explicitly in the autosuspend_check() routine.  The
    updated code keeps things from getting that far by using
    usb_autoresume_device() to increment the usage counter when a negative
    delay is set, and by using usb_autosuspend_device() to decrement the
    usage counter when a non-negative delay is set.
    
    This complicates the set_autosuspend() attribute method code slightly,
    but it will reduce the overall power management overhead.
    Signed-off-by: default avatarAlan Stern <stern@rowland.harvard.edu>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
    5899f1e0
sysfs.c 22.6 KB