Convert to plain udevice interaction with UDC controller
device, avoid the use of UDC uclass dev_array .

Signed-off-by: Marek Vasut <ma...@denx.de>
---
Cc: Angus Ainslie <an...@akkea.ca>
Cc: Dmitrii Merkurev <dimori...@google.com>
Cc: Eddie Cai <eddie.cai.li...@gmail.com>
Cc: Kever Yang <kever.y...@rock-chips.com>
Cc: Lukasz Majewski <lu...@denx.de>
Cc: Miquel Raynal <miquel.ray...@bootlin.com>
Cc: Mattijs Korpershoek <mkorpersh...@baylibre.com>
Cc: Nishanth Menon <n...@ti.com>
Cc: Patrice Chotard <patrice.chot...@foss.st.com>
Cc: Patrick Delaunay <patrick.delau...@foss.st.com>
Cc: Philipp Tomsich <philipp.toms...@vrull.eu>
Cc: Simon Glass <s...@chromium.org>
Cc: Stefan Roese <s...@denx.de>
Cc: ker...@puri.sm
---
 cmd/rockusb.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/cmd/rockusb.c b/cmd/rockusb.c
index f181ec61119..07088564a10 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;
 }
-- 
2.40.1

Reply via email to