From ac28e59a574dd231a4787752d923f618587e3d10 Mon Sep 17 00:00:00 2001 From: Kever Yang Date: Wed, 4 Mar 2020 08:59:50 +0800 Subject: usb: Migrate to support live DT for some driver Use ofnode_ instead of fdt_ APIs so that the drivers can support live DT. This patch updates usb_get_dr_mode() and usb_get_maximum_speed() to use ofnode as parameter instead of fdt offset. And all the drivers who use these APIs update to use live dt APIs at the same time. Signed-off-by: Kever Yang --- drivers/usb/musb-new/ti-musb.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'drivers/usb/musb-new') diff --git a/drivers/usb/musb-new/ti-musb.c b/drivers/usb/musb-new/ti-musb.c index 00759f3e83..608facefa3 100644 --- a/drivers/usb/musb-new/ti-musb.c +++ b/drivers/usb/musb-new/ti-musb.c @@ -285,14 +285,12 @@ U_BOOT_DRIVER(ti_musb_peripheral) = { #if CONFIG_IS_ENABLED(OF_CONTROL) static int ti_musb_wrapper_bind(struct udevice *parent) { - const void *fdt = gd->fdt_blob; - int node; + ofnode node; int ret; - for (node = fdt_first_subnode(fdt, dev_of_offset(parent)); node > 0; - node = fdt_next_subnode(fdt, node)) { + ofnode_for_each_subnode(node, parent->node) { struct udevice *dev; - const char *name = fdt_get_name(fdt, node, NULL); + const char *name = ofnode_get_name(node); enum usb_dr_mode dr_mode; struct driver *drv; @@ -306,7 +304,7 @@ static int ti_musb_wrapper_bind(struct udevice *parent) ret = device_bind_driver_to_node(parent, "ti-musb-peripheral", name, - offset_to_ofnode(node), + node, &dev); if (ret) pr_err("musb - not able to bind usb peripheral node\n"); @@ -316,7 +314,7 @@ static int ti_musb_wrapper_bind(struct udevice *parent) ret = device_bind_driver_to_node(parent, "ti-musb-host", name, - offset_to_ofnode(node), + node, &dev); if (ret) pr_err("musb - not able to bind usb host node\n"); -- cgit v1.2.3