Skip to content
Commit 718f1d41 authored by Marek Vasut's avatar Marek Vasut
Browse files

usb: gadget: ether: Handle gadget driver registration in probe and remove



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: default avatarMarek Vasut <marex@denx.de>
Tested-by: default avatarTom Rini <trini@konsulko.com>
Reviewed-by: default avatarTom Rini <trini@konsulko.com>
parent 47b121f4
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment