From mboxrd@z Thu Jan 1 00:00:00 1970 From: Vitaly Kuzmichev Date: Mon, 29 Nov 2010 17:06:10 +0300 Subject: [U-Boot] [PATCH] usb_ether: register usb ethernet gadget at each eth init In-Reply-To: <4CF3B100.3080700@mvista.com> References: <1290741661-28108-1-git-send-email-leiwen@marvell.com> <4CEFFB0A.3080804@mvista.com> <4CF3B100.3080700@mvista.com> Message-ID: <4CF3B352.20503@mvista.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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.