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