Re: [PATCH v2 02/12] usb: chipidea: permit driver bindings pass phy pointer

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

Marek Vasut <marex@xxxxxxx> writes:

> Dear Alexander Shishkin,
>
>> Richard Zhao <richard.zhao@xxxxxxxxxxxxx> writes:
>> 
>> Hi,
>> 
>> > Sometimes, the driver bindings may know what phy they use.
>> > For example, when using device tree, the usb controller may have a
>> > phandler pointing to usb phy.
>> 
>> Some comments below:
>> 
>> [snip]
>> 
>> >  	ci->dev = dev;
>> >  	ci->udc_driver = dev->platform_data;
>> > 
>> > +	if (ci->udc_driver->phy)
>> > +		ci->transceiver = ci->udc_driver->phy;
>> > +	else
>> > +		ci->global_phy = 1;
>> 
>> Nitpick: since it's a bool, don't you want to use "true" instead?
>> 
>> [snip]
>> 
>> > +#include <linux/usb/otg.h>
>> > +
>> > 
>> >  struct ci13xxx;
>> >  struct ci13xxx_udc_driver {
>> >  
>> >  	const char	*name;
>> >  	/* offset of the capability registers */
>> >  	uintptr_t	 capoffset;
>> >  	unsigned	 power_budget;
>> > 
>> > +	struct usb_phy	*phy;
>> 
>> This structure is really platform information, not per-device
>> instance. Consider, for example, situation when you have 2 controllers
>> in one system, they'll be using the same platform structure, but they'll
>> have different phys. Right?
>
> Not really, won't you allocate separate structure for them?

Currently, it's a static structure, see 05/12 and my comment there.

Regards,
--
Alex

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel


[Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [PDAs]     [Linux]     [Linux MIPS]     [Yosemite Campsites]     [Photos]

Add to Google Follow linuxarm on Twitter