]> git.baikalelectronics.ru Git - uboot.git/commitdiff
dm: core: Rename device_bind() to device_bind_offset()
authorSimon Glass <sjg@chromium.org>
Sun, 29 Nov 2020 00:50:00 +0000 (17:50 -0700)
committerSimon Glass <sjg@chromium.org>
Sun, 13 Dec 2020 14:58:17 +0000 (07:58 -0700)
This function is not necessary anymore, since device_bind_ofnode() does
the same thing and works with both flattree and livetree.

Rename it to indicate that it is special.

Signed-off-by: Simon Glass <sjg@chromium.org>
20 files changed:
arch/x86/cpu/apollolake/spl.c
drivers/clk/clk.c
drivers/core/device.c
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/net/mvpp2.c
drivers/pinctrl/broadcom/pinctrl-bcm283x.c
drivers/pinctrl/meson/pinctrl-meson.c
drivers/pinctrl/mscc/pinctrl-jr2.c
drivers/pinctrl/mscc/pinctrl-luton.c
drivers/pinctrl/mscc/pinctrl-ocelot.c
drivers/pinctrl/mscc/pinctrl-serval.c
drivers/pinctrl/mscc/pinctrl-servalt.c
drivers/pinctrl/mvebu/pinctrl-armada-37xx.c
drivers/power/regulator/Kconfig
include/dm/device-internal.h
include/power/regulator.h

index 089b37c59f8f3f6f17b1e74c707f026c7bb55260..1f75e1894b7a0bf106887a737945d00797823964 100644 (file)
@@ -86,7 +86,7 @@ static int apl_flash_probe(struct udevice *dev)
 /*
  * Manually set the parent of the SPI flash to SPI, since dtoc doesn't. We also
  * need to allocate the parent_platdata since by the time this function is
- * called device_bind() has already gone past that step.
+ * called device_bind_offset() has already gone past that step.
  */
 static int apl_flash_bind(struct udevice *dev)
 {
index 319808d433f5d21c004731d209667e07f0f23d73..1fa9bec6fea3ce9495bb3defa0bc52c02cabafa6 100644 (file)
@@ -36,7 +36,7 @@ int clk_register(struct clk *clk, const char *drv_name,
                return -ENOENT;
        }
 
-       ret = device_bind(parent, drv, name, NULL, -1, &clk->dev);
+       ret = device_bind_offset(parent, drv, name, NULL, -1, &clk->dev);
        if (ret) {
                printf("%s: CLK: %s driver bind error [%d]!\n", __func__, name,
                       ret);
index 4b3dcb3b379ad4d0ca99c114de0e1cbc7ec9a28c..081dd1f7780b3e08e43d27891129d49d2299f897 100644 (file)
@@ -232,9 +232,9 @@ int device_bind_with_driver_data(struct udevice *parent,
                                  0, devp);
 }
 
-int device_bind(struct udevice *parent, const struct driver *drv,
-               const char *name, void *platdata, int of_offset,
-               struct udevice **devp)
+int device_bind_offset(struct udevice *parent, const struct driver *drv,
+                      const char *name, void *platdata, int of_offset,
+                      struct udevice **devp)
 {
        return device_bind_common(parent, drv, name, platdata, 0,
                                  offset_to_ofnode(of_offset), 0, devp);
index 612413e17bca7c2006163f8ea6c4c09ec40f47f6..b64bc838a31ffc0fc5619ce309914a8aed2f44f4 100644 (file)
@@ -157,8 +157,8 @@ static int gpio_mediatek_bind(struct udevice *parent)
                plat->gpio_count = MTK_BANK_WIDTH;
                plat->bank = bank;
 
-               ret = device_bind(parent, parent->driver,
-                                 plat->bank_name, plat, -1, &dev);
+               ret = device_bind_offset(parent, parent->driver,
+                                        plat->bank_name, plat, -1, &dev);
                if (ret)
                        return ret;
 
index c78227f4da3bcd7e1fcf4f1f575f3d3cda1fc6d0..4f9fedd61294fcf5522ec5746f9ac531acf9a14b 100644 (file)
@@ -332,8 +332,8 @@ static int gpio_exynos_bind(struct udevice *parent)
                        return -ENOMEM;
 
                plat->bank_name = fdt_get_name(blob, node, NULL);
-               ret = device_bind(parent, parent->driver,
-                                 plat->bank_name, plat, -1, &dev);
+               ret = device_bind_offset(parent, parent->driver,
+                                        plat->bank_name, plat, -1, &dev);
                if (ret)
                        return ret;
 
index 02c3471b5684702e5c6dde563e404cf070893c6b..f18f0c8152cf7e2917f0bfd89ba29c9b0de2605f 100644 (file)
@@ -305,8 +305,8 @@ static int gpio_sunxi_bind(struct udevice *parent)
                plat->bank_name = gpio_bank_name(soc_data->start + bank);
                plat->gpio_count = SUNXI_GPIOS_PER_BANK;
 
-               ret = device_bind(parent, parent->driver,
-                                       plat->bank_name, plat, -1, &dev);
+               ret = device_bind_offset(parent, parent->driver,
+                                        plat->bank_name, plat, -1, &dev);
                if (ret)
                        return ret;
                dev_set_of_offset(dev, dev_of_offset(parent));
index 6626b5415a389d97176032e29f92e7bb1dafbd7d..a518a395cabd380d200e8f62d6d73d8564c6ed01 100644 (file)
@@ -190,8 +190,8 @@ static int tegra186_gpio_bind(struct udevice *parent)
                plat->name = ctlr_data->ports[port].name;
                plat->regs = &(regs[ctlr_data->ports[port].offset / 4]);
 
-               ret = device_bind(parent, parent->driver, plat->name, plat,
-                                 -1, &dev);
+               ret = device_bind_offset(parent, parent->driver, plat->name,
+                                        plat, -1, &dev);
                if (ret)
                        return ret;
                dev_set_of_offset(dev, dev_of_offset(parent));
index 912577a5719135b5da22099ca828cfe1f43588ba..0056171fc518c2d1aa14a913b5a65b3b40f57647 100644 (file)
@@ -360,8 +360,9 @@ static int gpio_tegra_bind(struct udevice *parent)
                        plat->base_gpio = TEGRA_GPIOS_PER_PORT * base_port;
                        plat->port_name = gpio_port_name(base_port);
 
-                       ret = device_bind(parent, parent->driver,
-                                         plat->port_name, plat, -1, &dev);
+                       ret = device_bind_offset(parent, parent->driver,
+                                                plat->port_name, plat, -1,
+                                                &dev);
                        if (ret)
                                return ret;
                        dev_set_of_offset(dev, dev_of_offset(parent));
index 8f790a8b44cd0bfaf5c19562b3434293a4cc3b46..df77a0d5e8ea04f79082e7ec871e0d7771d31d23 100644 (file)
@@ -5477,7 +5477,7 @@ static int mvpp2_base_bind(struct udevice *parent)
                sprintf(name, "mvpp2-%d", id);
 
                /* Create child device UCLASS_ETH and bind it */
-               device_bind(parent, &mvpp2_driver, name, plat, subnode, &dev);
+               device_bind_offset(parent, &mvpp2_driver, name, plat, subnode, &dev);
                dev_set_of_offset(dev, subnode);
        }
 
index 41da8141232967b43f44e12f07ff5c28653f5e95..54928a607cb2fab13e2f6d83d69e26903d0a107c 100644 (file)
@@ -125,8 +125,9 @@ int bcm283x_pinctl_probe(struct udevice *dev)
        struct udevice *pdev;
 
        /* Create GPIO device as well */
-       ret = device_bind(dev, lists_driver_lookup_name("gpio_bcm2835"),
-                         "gpio_bcm2835", NULL, dev_of_offset(dev), &pdev);
+       ret = device_bind_offset(dev, lists_driver_lookup_name("gpio_bcm2835"),
+                                "gpio_bcm2835", NULL, dev_of_offset(dev),
+                                &pdev);
        if (ret) {
                /*
                 * While we really want the pinctrl driver to work to make
index d4539b02d881ae47a04be0136a2fc555643e2701..45a1ccf58d623f84ae6a5b8a1a8fd81243757b63 100644 (file)
@@ -419,7 +419,7 @@ int meson_pinctrl_probe(struct udevice *dev)
        sprintf(name, "meson-gpio");
 
        /* Create child device UCLASS_GPIO and bind it */
-       device_bind(dev, priv->data->gpio_driver, name, NULL, gpio, &gpio_dev);
+       device_bind_offset(dev, priv->data->gpio_driver, name, NULL, gpio, &gpio_dev);
        dev_set_of_offset(gpio_dev, gpio);
 
        return 0;
index 72a9470854ebdc4b9215a41249b21849887bffdf..fc730b79d6adefd73d6f7b1c170a41d9e74bb2b2 100644 (file)
@@ -299,8 +299,8 @@ static int jr2_pinctrl_probe(struct udevice *dev)
        if (ret)
                return ret;
 
-       ret = device_bind(dev, &jr2_gpio_driver, "jr2-gpio", NULL,
-                         dev_of_offset(dev), NULL);
+       ret = device_bind_offset(dev, &jr2_gpio_driver, "jr2-gpio", NULL,
+                                dev_of_offset(dev), NULL);
 
        if (ret)
                return ret;
index 17fbc53c257800b998e76bbc2a266c7907969aea..4fb17984abe63b564ee371bcf2d263437d12f224 100644 (file)
@@ -165,8 +165,8 @@ int luton_pinctrl_probe(struct udevice *dev)
        if (ret)
                return ret;
 
-       ret = device_bind(dev, &luton_gpio_driver, "luton-gpio", NULL,
-                         dev_of_offset(dev), NULL);
+       ret = device_bind_offset(dev, &luton_gpio_driver, "luton-gpio", NULL,
+                                dev_of_offset(dev), NULL);
 
        return 0;
 }
index 49e026bc98b8ee786210968c4bd70b15b05e4e60..12ecad7a6e97ee5f4a54939612c251e50894725a 100644 (file)
@@ -181,8 +181,8 @@ int ocelot_pinctrl_probe(struct udevice *dev)
        if (ret)
                return ret;
 
-       ret = device_bind(dev, &ocelot_gpio_driver, "ocelot-gpio", NULL,
-                         dev_of_offset(dev), NULL);
+       ret = device_bind_offset(dev, &ocelot_gpio_driver, "ocelot-gpio", NULL,
+                                dev_of_offset(dev), NULL);
 
        return ret;
 }
index d59f08d4eb782ff0462d337d8b5c30dc656b26f6..93b31d208330687f0ea14df189579289fa95c392 100644 (file)
@@ -209,8 +209,8 @@ static int serval_pinctrl_probe(struct udevice *dev)
        if (ret)
                return ret;
 
-       ret = device_bind(dev, &serval_gpio_driver, "serval-gpio", NULL,
-                         dev_of_offset(dev), NULL);
+       ret = device_bind_offset(dev, &serval_gpio_driver, "serval-gpio", NULL,
+                                dev_of_offset(dev), NULL);
 
        if (ret)
                return ret;
index 592b7c547b7c7028309e5ba4cc6bd2ba8116b251..9bbc7698a52d652ea9235a8860d7774c253067d6 100644 (file)
@@ -245,8 +245,8 @@ static int servalt_pinctrl_probe(struct udevice *dev)
        if (ret)
                return ret;
 
-       ret = device_bind(dev, &servalt_gpio_driver, "servalt-gpio", NULL,
-                         dev_of_offset(dev), NULL);
+       ret = device_bind_offset(dev, &servalt_gpio_driver, "servalt-gpio", NULL,
+                                dev_of_offset(dev), NULL);
 
        if (ret)
                return ret;
index fb497803b9391fc36d7a858952799e366d7b935b..7bbeb413ba52a991ecbf430c098f4b188b6d41c4 100644 (file)
@@ -567,8 +567,8 @@ static int armada_37xx_gpiochip_register(struct udevice *parent,
        sprintf(name, "armada-37xx-gpio");
 
        /* Create child device UCLASS_GPIO and bind it */
-       device_bind(parent, &armada_37xx_gpio_driver, name, NULL, subnode,
-                   &dev);
+       device_bind_offset(parent, &armada_37xx_gpio_driver, name, NULL,
+                          subnode, &dev);
        dev_set_of_offset(dev, subnode);
 
        return 0;
index d431102462a82ddb6c66c500e513fe402e3d014a..a6f78d96706efd18a35f1e5c6348bd53eebcd56d 100644 (file)
@@ -11,7 +11,7 @@ config DM_REGULATOR
        - 'include/power/regulator.h'
        - 'drivers/power/pmic/pmic-uclass.c'
        - 'drivers/power/pmic/regulator-uclass.c'
-       It's important to call the device_bind() with the proper node offset,
+       It's important to call the device_bind_offset() with the proper node offset,
        when binding the regulator devices. The pmic_bind_childs() can be used
        for this purpose if PMIC I/O driver is implemented or dm_scan_fdt_dev()
        otherwise. Detailed information can be found in the header file.
index c5d7ec0650f97b344fa0571fec79b13d300c180c..59d3be09a1e5e85a586d4efbef15f93ca5de69ee 100644 (file)
@@ -16,7 +16,7 @@ struct device_node;
 struct udevice;
 
 /**
- * device_bind() - Create a device and bind it to a driver
+ * device_bind_offset() - Create a device and bind it to a driver
  *
  * Called to set up a new device attached to a driver. The device will either
  * have platdata, or a device tree node which can be used to create the
@@ -36,9 +36,9 @@ struct udevice;
  * @devp: if non-NULL, returns a pointer to the bound device
  * @return 0 if OK, -ve on error
  */
-int device_bind(struct udevice *parent, const struct driver *drv,
-               const char *name, void *platdata, int of_offset,
-               struct udevice **devp);
+int device_bind_offset(struct udevice *parent, const struct driver *drv,
+                      const char *name, void *platdata, int of_offset,
+                      struct udevice **devp);
 
 int device_bind_ofnode(struct udevice *parent, const struct driver *drv,
                       const char *name, void *platdata, ofnode node,
index 7f278e8c7dca92471ecb33f45fe93e452bbdb667..4d58a436fea94894b43413528b8931ef3ce98109 100644 (file)
@@ -48,7 +48,7 @@
  * If regulator-name property is not provided, node name will be chosen.
  *
  * Regulator bind:
- * For each regulator device, the device_bind() should be called with passed
+ * For each regulator device, the device_bind_offset() should be called with passed
  * device tree offset. This is required for this uclass's '.post_bind' method,
  * which does the scan on the device node, for the 'regulator-name' constraint.
  * If the parent is not a PMIC device, and the child is not bind by function: