diff options
author | Fabio Estevam <festevam@denx.de> | 2021-06-20 12:00:51 -0300 |
---|---|---|
committer | Marek Vasut <marex@denx.de> | 2021-06-24 20:23:23 +0200 |
commit | ec326b932512cfe07dd97cc45480c87b903e08e3 (patch) | |
tree | 9901c55da6c37922d6bc76a14f85dcf23c1dc847 | |
parent | fcf3981161140d265b873a5b609b8867328dc9dc (diff) | |
download | u-boot-ec326b932512cfe07dd97cc45480c87b903e08e3.zip u-boot-ec326b932512cfe07dd97cc45480c87b903e08e3.tar.gz u-boot-ec326b932512cfe07dd97cc45480c87b903e08e3.tar.bz2 |
usb: ehci-mx6: Move fdtdec_get_alias_seq() inside the CONFIG_MX6
On a imx7s-warp board the fdtdec_get_alias_seq() function
always fails.
As priv->portnr is only used on i.MX6, move fdtdec_get_alias_seq()
inside the CONFIG_MX6 block.
Signed-off-by: Fabio Estevam <festevam@denx.de>
-rw-r--r-- | drivers/usb/host/ehci-mx6.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/drivers/usb/host/ehci-mx6.c b/drivers/usb/host/ehci-mx6.c index 238c931..48b5c8b 100644 --- a/drivers/usb/host/ehci-mx6.c +++ b/drivers/usb/host/ehci-mx6.c @@ -569,7 +569,6 @@ static int mx6_parse_dt_addrs(struct udevice *dev) const void *blob = gd->fdt_blob; int offset = dev_of_offset(dev); void *__iomem addr; - int ret, devnump; phy_off = fdtdec_lookup_phandle(blob, offset, "fsl,usbphy"); if (phy_off < 0) { @@ -578,11 +577,6 @@ static int mx6_parse_dt_addrs(struct udevice *dev) return -EINVAL; } - ret = fdtdec_get_alias_seq(blob, dev->uclass->uc_drv->name, - phy_off, &devnump); - if (ret < 0) - return ret; - misc_off = fdtdec_lookup_phandle(blob, offset, "fsl,usbmisc"); if (misc_off < 0) return -EINVAL; @@ -592,7 +586,6 @@ static int mx6_parse_dt_addrs(struct udevice *dev) return -EINVAL; priv->phy_addr = addr; - priv->portnr = devnump; addr = (void __iomem *)fdtdec_get_addr(blob, misc_off, "reg"); if ((fdt_addr_t)addr == FDT_ADDR_T_NONE) @@ -601,7 +594,13 @@ static int mx6_parse_dt_addrs(struct udevice *dev) priv->misc_addr = addr; #if defined(CONFIG_MX6) - int anatop_off; + int anatop_off, ret, devnump; + + ret = fdtdec_get_alias_seq(blob, dev->uclass->uc_drv->name, + phy_off, &devnump); + if (ret < 0) + return ret; + priv->portnr = devnump; /* Resolve ANATOP offset through USB PHY node */ anatop_off = fdtdec_lookup_phandle(blob, phy_off, "fsl,anatop"); |