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 05/17/2013 05:49 PM, Alan Stern wrote:
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.



Thanks for the input, I'll make those changes and send a new version

-Mathias
--
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