diff options
author | Marek Vasut <marex@denx.de> | 2023-09-01 11:49:51 +0200 |
---|---|---|
committer | Marek Vasut <marex@denx.de> | 2023-09-15 23:38:01 +0200 |
commit | 0669a929b87d4ef5d8f1617e096e6b248ed61108 (patch) | |
tree | 428d74ef07db4a66c9cc871308525116f7807feb /cmd | |
parent | bac356c3082cc0b6b8da60ce3366c09229181ac0 (diff) | |
download | u-boot-0669a929b87d4ef5d8f1617e096e6b248ed61108.tar.gz u-boot-0669a929b87d4ef5d8f1617e096e6b248ed61108.tar.bz2 u-boot-0669a929b87d4ef5d8f1617e096e6b248ed61108.zip |
cmd: rockusb: Use plain udevice for UDC controller interaction
Convert to plain udevice interaction with UDC controller
device, avoid the use of UDC uclass dev_array .
Signed-off-by: Marek Vasut <marex@denx.de>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/rockusb.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/cmd/rockusb.c b/cmd/rockusb.c index f181ec6111..07088564a1 100644 --- a/cmd/rockusb.c +++ b/cmd/rockusb.c @@ -15,6 +15,7 @@ static int do_rockusb(struct cmd_tbl *cmdtp, int flag, int argc, { int controller_index, dev_index; char *usb_controller; + struct udevice *udc; char *devtype; char *devnum; int ret; @@ -34,7 +35,7 @@ static int do_rockusb(struct cmd_tbl *cmdtp, int flag, int argc, dev_index = simple_strtoul(devnum, NULL, 0); rockusb_dev_init(devtype, dev_index); - ret = usb_gadget_initialize(controller_index); + ret = udc_device_get_by_index(controller_index, &udc); if (ret) { printf("USB init failed: %d\n", ret); return CMD_RET_FAILURE; @@ -56,14 +57,14 @@ static int do_rockusb(struct cmd_tbl *cmdtp, int flag, int argc, break; if (ctrlc()) break; - usb_gadget_handle_interrupts(controller_index); + dm_usb_gadget_handle_interrupts(udc); } ret = CMD_RET_SUCCESS; exit: g_dnl_unregister(); g_dnl_clear_detach(); - usb_gadget_release(controller_index); + udc_device_put(udc); return ret; } |