dm: core: Replace of_offset with accessor
[oweals/u-boot.git] / drivers / usb / host / ehci-exynos.c
index 18e9251b64f5c1cadd5e4121fb99a753c70a75a6..981543e31501cd6ad7fe10e2704ff39dabb8cd69 100644 (file)
@@ -18,7 +18,7 @@
 #include <asm/arch/system.h>
 #include <asm/arch/power.h>
 #include <asm/gpio.h>
-#include <asm-generic/errno.h>
+#include <linux/errno.h>
 #include <linux/compat.h>
 #include "ehci.h"
 
@@ -59,7 +59,7 @@ static int ehci_usb_ofdata_to_platdata(struct udevice *dev)
        }
 
        depth = 0;
-       node = fdtdec_next_compatible_subnode(blob, dev->of_offset,
+       node = fdtdec_next_compatible_subnode(blob, dev_of_offset(dev),
                                COMPAT_SAMSUNG_EXYNOS_USB_PHY, &depth);
        if (node <= 0) {
                debug("XHCI: Can't get device node for usb3-phy controller\n");
@@ -219,14 +219,14 @@ static int ehci_usb_probe(struct udevice *dev)
 
        ctx->hcd = (struct ehci_hccr *)plat->hcd_base;
        ctx->usb = (struct exynos_usb_phy *)plat->phy_base;
-       hcor = (struct ehci_hcor *)((uint32_t)ctx->hcd +
-                       HC_LENGTH(ehci_readl(&ctx->hcd->cr_capbase)));
 
        /* setup the Vbus gpio here */
        if (dm_gpio_is_valid(&plat->vbus_gpio))
                dm_gpio_set_value(&plat->vbus_gpio, 1);
 
        setup_usb_phy(ctx->usb);
+       hcor = (struct ehci_hcor *)((uint32_t)ctx->hcd +
+                       HC_LENGTH(ehci_readl(&ctx->hcd->cr_capbase)));
 
        return ehci_register(dev, ctx->hcd, hcor, NULL, 0, USB_INIT_HOST);
 }