Re: [RFC PATCH 2/4] usb: add platform_data in the struct usb_hub_port

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

 



On Mon, 19 Mar 2012, Lan Tianyu wrote:

> Add the member platform_data in the usb_hub_port to store port's
> platform related data. Provide usb_set_hub_port_platform_data() and
> usb_get_hub_port_platform_data() to access the member.

> +int usb_set_hub_port_platform_data(struct usb_device *udev, int port,
> +	unsigned long data)

The argument is a 1-based port number, so it should be called "port1" 
instead of "port".

The same change needs to be made in other places in your patch series.

> +{
> +	struct usb_hub *hub = hdev_to_hub(udev);
> +
> +	if (port > hub->descriptor->bNbrPorts || port < 1)

Use udev->maxchild instead of hub->descriptor->bNbrPorts.  Same thing 
in usb_get_hub_port_platform_data().

> +		return -EINVAL;
> +	hub->port_data[port - 1].platform_data = data;
> +	return 0;
> +}

Alan Stern

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


[Index of Archives]     [Linux IBM ACPI]     [Linux Power Management]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux