summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorMarek Vasut <marex@denx.de>2023-09-01 11:49:50 +0200
committerMarek Vasut <marex@denx.de>2023-09-15 23:38:01 +0200
commitbac356c3082cc0b6b8da60ce3366c09229181ac0 (patch)
treef96ccbf2340c4b76f1f3e07141aada024d5e89b4 /cmd
parentead3a28c1424684c53b5e4004ce73c8b1d675691 (diff)
downloadu-boot-bac356c3082cc0b6b8da60ce3366c09229181ac0.tar.gz
u-boot-bac356c3082cc0b6b8da60ce3366c09229181ac0.tar.bz2
u-boot-bac356c3082cc0b6b8da60ce3366c09229181ac0.zip
cmd: fastboot: Use plain udevice for UDC controller interaction
Convert to plain udevice interaction with UDC controller device, avoid the use of UDC uclass dev_array . Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com> Tested-by: Mattijs Korpershoek <mkorpershoek@baylibre.com> # on khadas vim3 Signed-off-by: Marek Vasut <marex@denx.de>
Diffstat (limited to 'cmd')
-rw-r--r--cmd/fastboot.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/cmd/fastboot.c b/cmd/fastboot.c
index 3d5ff951eb..17fb0a0aa7 100644
--- a/cmd/fastboot.c
+++ b/cmd/fastboot.c
@@ -61,6 +61,7 @@ static int do_fastboot_usb(int argc, char *const argv[],
{
int controller_index;
char *usb_controller;
+ struct udevice *udc;
char *endp;
int ret;
@@ -79,7 +80,7 @@ static int do_fastboot_usb(int argc, char *const argv[],
return CMD_RET_FAILURE;
}
- ret = usb_gadget_initialize(controller_index);
+ ret = udc_device_get_by_index(controller_index, &udc);
if (ret) {
pr_err("USB init failed: %d\n", ret);
return CMD_RET_FAILURE;
@@ -103,13 +104,13 @@ static int do_fastboot_usb(int argc, char *const argv[],
if (ctrlc())
break;
schedule();
- usb_gadget_handle_interrupts(controller_index);
+ dm_usb_gadget_handle_interrupts(udc);
}
ret = CMD_RET_SUCCESS;
exit:
- usb_gadget_release(controller_index);
+ udc_device_put(udc);
g_dnl_unregister();
g_dnl_clear_detach();