Re: [PATCH v1 2/2] usb: otg: support for multiple transceivers by a single controller

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

 



Hi Alexander,

On Mon, May 28, 2012 at 9:45 PM, Alexander Shishkin
<alexander.shishkin@xxxxxxxxxxxxxxx> wrote:
> Felipe Balbi <balbi@xxxxxx> writes:
>
>> static struct usb_phy * __usb_find_phy(struct list_head *list,
>>       enum usb_phy_type type)
>> {
>>       struct usb_phy  *phy = NULL;
>>
>>       list_for_each_entry(phy, list, head) {
>>               if (phy->type != type)
>>                       continue;
>>
>>               return phy;
>>       }
>>
>>       return ERR_PTR(-ENODEV);
>> }
>>
>> then usb_get_phy() would look something like:
>
> Actually, since you only permit one transceiver of each type (which
> makes the total of 2), can't it simply be an array indexed by enum
> usb_phy_type? Since this code is an interim solution anyway (until we
> have proper multiphy support), it would be much simpler like that.

When we have proper multiphy support, that will only be an extension
of this patch. Making it an array for this patch series means, we'll
again have to come back to _list_  when we support multiple
transceivers of each type.
So I'd like to go with _list_ and extend this patch when we have full
multi-phy support.

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