@@ -2579,7 +2579,7 @@ static int cdns3_gadget_start(struct cdns3 *cdns)
if (!priv_dev->onchip_buffers)
priv_dev->onchip_buffers = 256;
- max_speed = usb_get_maximum_speed(dev_of_offset(cdns->dev));
+ max_speed = usb_get_maximum_speed(dev_ofnode(cdns->dev));
/* Check the maximum_speed parameter */
switch (max_speed) {
@@ -47,13 +47,12 @@ static const char *const speed_names[] = {
[USB_SPEED_SUPER] = "super-speed",
};
-enum usb_device_speed usb_get_maximum_speed(int node)
+enum usb_device_speed usb_get_maximum_speed(ofnode node)
{
- const void *fdt = gd->fdt_blob;
const char *max_speed;
int i;
- max_speed = fdt_getprop(fdt, node, "maximum-speed", NULL);
+ max_speed = ofnode_read_string(node, "maximum-speed");
if (!max_speed) {
pr_err("usb maximum-speed not found\n");
return USB_SPEED_UNKNOWN;
@@ -92,7 +92,7 @@ static int dwc3_generic_ofdata_to_platdata(struct udevice *dev)
plat->base = dev_read_addr(dev);
- plat->maximum_speed = usb_get_maximum_speed(ofnode_to_offset(node));
+ plat->maximum_speed = usb_get_maximum_speed(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;
@@ -29,11 +29,11 @@ enum usb_dr_mode usb_get_dr_mode(ofnode node);
/**
* usb_get_maximum_speed() - Get maximum speed for given device
- * @node: Node offset to the given device
+ * @node: ofnode of the given device
*
* The function gets phy interface string from property 'maximum-speed',
* and returns the correspondig enum usb_device_speed
*/
-enum usb_device_speed usb_get_maximum_speed(int node);
+enum usb_device_speed usb_get_maximum_speed(ofnode node);
#endif /* __LINUX_USB_OTG_H */
ofnode is more common and no need to convert to offset after we migrate other API to use ofnode. Signed-off-by: Kever Yang <kever.yang at rock-chips.com> --- Changes in v2: None drivers/usb/cdns3/gadget.c | 2 +- drivers/usb/common/common.c | 5 ++--- drivers/usb/dwc3/dwc3-generic.c | 2 +- include/linux/usb/otg.h | 4 ++-- 4 files changed, 6 insertions(+), 7 deletions(-)