[PATCH v5 3/3] usb: gadget: ether: Handle gadget driver registration in probe and remove

Tom Rini trini at konsulko.com
Fri Aug 4 18:06:44 CEST 2023


On Fri, Aug 04, 2023 at 05:41:11PM +0200, Marek Vasut wrote:

> Move the ethernet gadget driver registration and removal from ethernet
> bind and unbind callbacks into driver DM probe and remove callbacks.
> This way, when the driver is bound, which is triggered deliberately
> using 'bind' command, the USB ethernet gadget driver is instantiated
> and bound to the matching UDC. In reverse, when the driver is unbound,
> which is again triggered deliberately using 'unbind' command, the USB
> ethernet gadget driver instance is removed.
> 
> Effectively, this now behaves like running either 'ums' or 'dfu' or
> any other commands utilizing USB gadget functionality.
> 
> This also drops use of usb_gadget_release() and moves the use of
> usb_gadget_initialize() into usb_ether_init() used only by legacy
> platforms that do not use 'bind' command properly yet. Those have
> no place in drivers.
> 
> Signed-off-by: Marek Vasut <marex at denx.de>

Tested-by: Tom Rini <trini at konsulko.com>

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20230804/fa9da0ee/attachment.sig>


More information about the U-Boot mailing list