On 7/19/23 03:08, Simon Glass wrote:
On Mon, 17 Jul 2023 at 05:21, Marek Vasut <ma...@denx.de> wrote:

Extend the driver core to perform lookup by both OF node and driver
bound to the node. Use this to look up specific device instances to
unbind from nodes in the unbind command. One example where this is
needed is USB peripheral controller, which may have multiple gadget
drivers bound to it. The unbind command has to select that specific
gadget driver instance to unbind from the controller, not unbind the
controller driver itself from the controller.

USB ethernet gadget usage looks as follows with this change. Notice
the extra 'usb_ether' addition in the 'unbind' command at the end.
"
bind /soc/usb-otg@49000000 usb_ether
setenv ethact usb_ether
setenv loadaddr 0xc2000000
setenv ipaddr 10.0.0.2
setenv serverip 10.0.0.1
setenv netmask 255.255.255.0
tftpboot 0xc2000000 10.0.0.1:test.file
unbind /soc/usb-otg@49000000 usb_ether
"

Signed-off-by: Marek Vasut <ma...@denx.de>
---
Cc: Kevin Hilman <khil...@baylibre.com>
Cc: Lukasz Majewski <lu...@denx.de>
Cc: Marek Vasut <ma...@denx.de>
Cc: Simon Glass <s...@chromium.org>
---
V2: No change
---
  cmd/bind.c            | 10 +++++-----
  drivers/core/device.c | 20 +++++++++++++++-----
  include/dm/device.h   | 17 +++++++++++++++++
  3 files changed, 37 insertions(+), 10 deletions(-)

Can we have a test?

I added it into my todo queue.

Anything else or is the patch OK ?

Reply via email to