diff options
author | Kever Yang <kever.yang@rock-chips.com> | 2020-03-04 03:59:50 +0300 |
---|---|---|
committer | Marek Vasut <marek.vasut+renesas@gmail.com> | 2020-03-30 04:48:53 +0300 |
commit | ac28e59a574dd231a4787752d923f618587e3d10 (patch) | |
tree | 25af956b562bdb145d755f0130e1d6fed992cf89 /drivers/usb/gadget/dwc2_udc_otg.c | |
parent | 2be1130a93059b4ca0af037b896bb998e9907f8b (diff) | |
download | u-boot-ac28e59a574dd231a4787752d923f618587e3d10.tar.xz |
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 <kever.yang@rock-chips.com>
Diffstat (limited to 'drivers/usb/gadget/dwc2_udc_otg.c')
-rw-r--r-- | drivers/usb/gadget/dwc2_udc_otg.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/usb/gadget/dwc2_udc_otg.c b/drivers/usb/gadget/dwc2_udc_otg.c index 496abf38e7..b9c814cf73 100644 --- a/drivers/usb/gadget/dwc2_udc_otg.c +++ b/drivers/usb/gadget/dwc2_udc_otg.c @@ -1039,13 +1039,12 @@ void dwc2_phy_shutdown(struct udevice *dev, struct phy *usb_phys, int num_phys) static int dwc2_udc_otg_ofdata_to_platdata(struct udevice *dev) { struct dwc2_plat_otg_data *platdata = dev_get_platdata(dev); - int node = dev_of_offset(dev); ulong drvdata; void (*set_params)(struct dwc2_plat_otg_data *data); int ret; - if (usb_get_dr_mode(node) != USB_DR_MODE_PERIPHERAL && - usb_get_dr_mode(node) != USB_DR_MODE_OTG) { + if (usb_get_dr_mode(dev->node) != USB_DR_MODE_PERIPHERAL && + usb_get_dr_mode(dev->node) != USB_DR_MODE_OTG) { dev_dbg(dev, "Invalid mode\n"); return -ENODEV; } |