[U-Boot] [PATCH] usb_ether: register usb ethernet gadget at each eth init
Vitaly Kuzmichev
vkuzmichev at mvista.com
Mon Nov 29 15:06:10 CET 2010
Vitaly Kuzmichev wrote:
> Hi Lei,
>
> Lei Wen wrote:
>> Hi Vitaly,
>> [...]
>>>> + if (usb_gadget_register_driver(ð_driver) < 0)
>>>> + goto fail;
>>>
>>> You probably need then at least to remove usb_gadget_register_driver
>>> call from usb_eth_initialize. And add usb_gadget_unregister_driver in
>>> usb_eth_halt.
>>
>> I am afraid that remove usb_gadget_register_driver call from usb_eth_initialize
>> is not possible. For tftp as example, it would call eth_halt before
>> the eth_init.
>> If we do the remove behavior, the gadget still not valid yet in the
>> first eth_halt call
>> which would cause the uboot becomes halt.
>
> The gadget driver handles this properly. Right now it just does
> usb_gadget_disconnect which has no effect when no gadget was requested
> from the UDC driver yet.
I was wrong...
usb_gadget_disconnect does not care about NULL pointer passed. :/
Best regards,
Vitaly.
More information about the U-Boot
mailing list