]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
dm: Drop uses of dev_set_of_offset()
authorSimon Glass <sjg@chromium.org>
Sun, 29 Nov 2020 00:50:04 +0000 (17:50 -0700)
committerSimon Glass <sjg@chromium.org>
Sun, 13 Dec 2020 14:58:18 +0000 (07:58 -0700)
The need for this can be avoided by passing the correct node to the
device_bind() function.

Signed-off-by: Simon Glass <sjg@chromium.org>
drivers/gpio/mt7621_gpio.c
drivers/gpio/s5p_gpio.c
drivers/gpio/sunxi_gpio.c
drivers/gpio/tegra186_gpio.c
drivers/gpio/tegra_gpio.c
drivers/pinctrl/meson/pinctrl-meson.c

index 8b41e34844ea69fd7fdae8d0a44082b6ed0750c6..ea51291e237e4e13354191f772442b6511b069fe 100644 (file)
@@ -158,11 +158,10 @@ static int gpio_mediatek_bind(struct udevice *parent)
                plat->bank = bank;
 
                ret = device_bind(parent, parent->driver, plat->bank_name, plat,
-                                 ofnode_null(), &dev);
+                                 node, &dev);
                if (ret)
                        return ret;
 
-               dev->node = node;
                bank++;
        }
 
index d6054c4a6ddfc0c56652b234886fa5fea639bc75..ec8d54922d3027897ea00f2e060ba1cc83b74734 100644 (file)
@@ -333,12 +333,10 @@ static int gpio_exynos_bind(struct udevice *parent)
 
                plat->bank_name = fdt_get_name(blob, node, NULL);
                ret = device_bind(parent, parent->driver, plat->bank_name, plat,
-                                 ofnode_null(), &dev);
+                                 offset_to_ofnode(node), &dev);
                if (ret)
                        return ret;
 
-               dev_set_of_offset(dev, node);
-
                reg = dev_read_addr(dev);
                if (reg != FDT_ADDR_T_NONE)
                        bank = (struct s5p_gpio_bank *)((ulong)base + reg);
index b6b0e9acbdba16516b72bcdad4779882e9a12a3d..dea71a7f340787ebf0e2b0c7d33f762c88f6d1f5 100644 (file)
@@ -306,10 +306,9 @@ static int gpio_sunxi_bind(struct udevice *parent)
                plat->gpio_count = SUNXI_GPIOS_PER_BANK;
 
                ret = device_bind(parent, parent->driver, plat->bank_name, plat,
-                                 ofnode_null(), &dev);
+                                 dev_ofnode(parent), &dev);
                if (ret)
                        return ret;
-               dev_set_of_offset(dev, dev_of_offset(parent));
        }
 
        return 0;
index bcc322c3b02a91b0d1b72ef835760a252debe093..ad97e13a1cbf8aaf210a2e01b571b40ed3ffa294 100644 (file)
@@ -191,10 +191,9 @@ static int tegra186_gpio_bind(struct udevice *parent)
                plat->regs = &(regs[ctlr_data->ports[port].offset / 4]);
 
                ret = device_bind(parent, parent->driver, plat->name, plat,
-                                 ofnode_null(), &dev);
+                                 dev_ofnode(parent), &dev);
                if (ret)
                        return ret;
-               dev_set_of_offset(dev, dev_of_offset(parent));
        }
 
        return 0;
index 3877ee659af566c3d1f5f8770da4326ce6b90ca0..22d25313227583cd50d7ecd87d2eb6ee56840d11 100644 (file)
@@ -361,11 +361,10 @@ static int gpio_tegra_bind(struct udevice *parent)
                        plat->port_name = gpio_port_name(base_port);
 
                        ret = device_bind(parent, parent->driver,
-                                         plat->port_name, plat, ofnode_null(),
-                                         &dev);
+                                         plat->port_name, plat,
+                                         dev_ofnode(parent), &dev);
                        if (ret)
                                return ret;
-                       dev_set_of_offset(dev, dev_of_offset(parent));
                }
        }
 
index c35e4c42a09662dbdfa4797159cae98f54d4c056..37bddb14e084e04d1b77a814f0edc70720619fb7 100644 (file)
@@ -422,7 +422,6 @@ int meson_pinctrl_probe(struct udevice *dev)
        /* Create child device UCLASS_GPIO and bind it */
        device_bind(dev, priv->data->gpio_driver, name, NULL,
                    offset_to_ofnode(gpio), &gpio_dev);
-       dev_set_of_offset(gpio_dev, gpio);
 
        return 0;
 }