Re: [PATCH] Correct autosuspend_delay for non-hubs.

Alan Stern <[email protected]>
Newsgroups gmane.linux.usb.devel
Message-ID <[email protected]>
On Fri, 21 Sep 2007, Sarah Sharp wrote:

> Without this patch, `cat /sys/bus/usb/devices/*/power/autosuspend` will return
> 0 for any device that is not a hub.  This happens because of the integer divide
> in show_autosuspend in sysfs.c
> 
> Signed-off-by: Sarah Sharp <[email protected]>
> ---
>  drivers/usb/core/quirks.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/usb/core/quirks.c b/drivers/usb/core/quirks.c
> index ebf3dc2..4a0e474 100644
> --- a/drivers/usb/core/quirks.c
> +++ b/drivers/usb/core/quirks.c
> @@ -156,6 +156,6 @@ void usb_detect_quirks(struct usb_device *udev)
>  	/* By default, disable autosuspend for all non-hubs */
>  #ifdef	CONFIG_USB_SUSPEND
>  	if (udev->descriptor.bDeviceClass != USB_CLASS_HUB)
> -		udev->autosuspend_delay = -1;
> +		udev->autosuspend_delay = -1 * HZ;
>  #endif
>  }

Amusingly, my patch as995 (submitted just a few minutes earlier) 
already includes this change.

Alan Stern



-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.