]> git.sur5r.net Git - u-boot/blobdiff - drivers/pci/pci-uclass.c
dm: core: Replace of_offset with accessor
[u-boot] / drivers / pci / pci-uclass.c
index 3b00e6a41b36c040e3c1298bf4f5b1248c51872a..a1408f5bf1ca7c157f4210759ae0a73617020ead 100644 (file)
@@ -839,8 +839,9 @@ static int pci_uclass_pre_probe(struct udevice *bus)
        /* For bridges, use the top-level PCI controller */
        if (!device_is_on_pci_bus(bus)) {
                hose->ctlr = bus;
-               ret = decode_regions(hose, gd->fdt_blob, bus->parent->of_offset,
-                               bus->of_offset);
+               ret = decode_regions(hose, gd->fdt_blob,
+                                    dev_of_offset(bus->parent),
+                                    dev_of_offset(bus));
                if (ret) {
                        debug("%s: Cannot decode regions\n", __func__);
                        return ret;
@@ -903,7 +904,7 @@ static int pci_uclass_child_post_bind(struct udevice *dev)
        struct fdt_pci_addr addr;
        int ret;
 
-       if (dev->of_offset == -1)
+       if (dev_of_offset(dev) == -1)
                return 0;
 
        /*
@@ -911,7 +912,7 @@ static int pci_uclass_child_post_bind(struct udevice *dev)
         * just check the address.
         */
        pplat = dev_get_parent_platdata(dev);
-       ret = fdtdec_get_pci_addr(gd->fdt_blob, dev->of_offset,
+       ret = fdtdec_get_pci_addr(gd->fdt_blob, dev_of_offset(dev),
                                  FDT_PCI_SPACE_CONFIG, "reg", &addr);
 
        if (ret) {