From patchwork Thu Feb 20 02:32:20 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kever Yang X-Patchwork-Id: 236615 List-Id: U-Boot discussion From: kever.yang at rock-chips.com (Kever Yang) Date: Thu, 20 Feb 2020 10:32:20 +0800 Subject: [PATCH v2 5/9] usb: dwc3-generic: Use dev_read_addr() instead of devfdt_get_addr() In-Reply-To: <20200220023224.32146-1-kever.yang@rock-chips.com> References: <20200220023224.32146-1-kever.yang@rock-chips.com> Message-ID: <20200220023224.32146-6-kever.yang@rock-chips.com> Use more common API so that we can support live DT. Signed-off-by: Kever Yang --- Changes in v2: None drivers/usb/dwc3/dwc3-generic.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/usb/dwc3/dwc3-generic.c b/drivers/usb/dwc3/dwc3-generic.c index 820cc7075c..ced0f53bfd 100644 --- a/drivers/usb/dwc3/dwc3-generic.c +++ b/drivers/usb/dwc3/dwc3-generic.c @@ -88,17 +88,17 @@ static int dwc3_generic_remove(struct udevice *dev, static int dwc3_generic_ofdata_to_platdata(struct udevice *dev) { struct dwc3_generic_plat *plat = dev_get_platdata(dev); - int node = dev_of_offset(dev); + ofnode node = dev->node; - plat->base = devfdt_get_addr(dev); + plat->base = dev_read_addr(dev); - plat->maximum_speed = usb_get_maximum_speed(node); + plat->maximum_speed = usb_get_maximum_speed(ofnode_to_offset(node)); if (plat->maximum_speed == USB_SPEED_UNKNOWN) { pr_info("No USB maximum speed specified. Using super speed\n"); plat->maximum_speed = USB_SPEED_SUPER; } - plat->dr_mode = usb_get_dr_mode(node); + plat->dr_mode = usb_get_dr_mode(ofnode_to_offset(node)); if (plat->dr_mode == USB_DR_MODE_UNKNOWN) { pr_err("Invalid usb mode setup\n"); return -ENODEV;