summaryrefslogtreecommitdiff
path: root/drivers/usb/host/dwc3-sti-glue.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/host/dwc3-sti-glue.c')
-rw-r--r--drivers/usb/host/dwc3-sti-glue.c20
1 files changed, 7 insertions, 13 deletions
diff --git a/drivers/usb/host/dwc3-sti-glue.c b/drivers/usb/host/dwc3-sti-glue.c
index ad7cf6e6b5..c99a1985cc 100644
--- a/drivers/usb/host/dwc3-sti-glue.c
+++ b/drivers/usb/host/dwc3-sti-glue.c
@@ -10,8 +10,6 @@
#include <asm/io.h>
#include <dm.h>
#include <errno.h>
-#include <fdtdec.h>
-#include <linux/libfdt.h>
#include <dm/lists.h>
#include <regmap.h>
#include <reset-uclass.h>
@@ -109,8 +107,7 @@ static int sti_dwc3_glue_ofdata_to_platdata(struct udevice *dev)
int ret;
u32 reg[4];
- ret = fdtdec_get_int_array(gd->fdt_blob, dev_of_offset(dev),
- "reg", reg, ARRAY_SIZE(reg));
+ ret = ofnode_read_u32_array(dev->node, "reg", reg, ARRAY_SIZE(reg));
if (ret) {
pr_err("unable to find st,stih407-dwc3 reg property(%d)\n", ret);
return ret;
@@ -153,18 +150,15 @@ static int sti_dwc3_glue_ofdata_to_platdata(struct udevice *dev)
static int sti_dwc3_glue_bind(struct udevice *dev)
{
struct sti_dwc3_glue_platdata *plat = dev_get_platdata(dev);
- int dwc3_node;
+ ofnode node, dwc3_node;
- /* check if one subnode is present */
- dwc3_node = fdt_first_subnode(gd->fdt_blob, dev_of_offset(dev));
- if (dwc3_node <= 0) {
- pr_err("Can't find subnode for %s\n", dev->name);
- return -ENODEV;
+ /* Find snps,dwc3 node from subnode */
+ ofnode_for_each_subnode(node, dev->node) {
+ if (ofnode_device_is_compatible(node, "snps,dwc3"))
+ dwc3_node = node;
}
- /* check if the subnode compatible string is the dwc3 one*/
- if (fdt_node_check_compatible(gd->fdt_blob, dwc3_node,
- "snps,dwc3") != 0) {
+ if (!ofnode_valid(node)) {
pr_err("Can't find dwc3 subnode for %s\n", dev->name);
return -ENODEV;
}