Re: [RFC PATCH 4/4] usb: add usb2 Link PM variables to sysfs and usb_device

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 17 May 2013, Mathias Nyman wrote:

> Adds abitilty to tune L1 timeout (inactivity timer for usb2 link sleep)
> and BESL (best effort service latency)via sysfs.
> 
> This also adds a new usb2_lpm_parameters structure with those variables to
> struct usb_device.

> +static ssize_t
> +set_usb2_lpm_l1_timeout(struct device *dev, struct device_attribute *attr,
> +			const char *buf, size_t count)
> +{
> +	struct usb_device *udev = to_usb_device(dev);
> +	int timeout;
> +
> +	if (sscanf(buf, "%d", &timeout) != 1 || timeout < 0 || timeout > 255)
> +		return -EINVAL;

New code should use the kstrto* family of functions.  You also could 
remove a test if you declared timeout to be unsigned instead of int.

Alan Stern

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




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux