summaryrefslogtreecommitdiff
path: root/drivers/pinctrl
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2020-11-29 03:50:03 +0300
committerSimon Glass <sjg@chromium.org>2020-12-13 17:58:18 +0300
commita2703ce10cfcbe6a82ec8ed9ec10df2aeea08e64 (patch)
tree3b1e2e1d33b9e0bc9120be2cee4c6ca966876857 /drivers/pinctrl
parent0de1b07406d709c3951dbb1a69ca196d80bd516d (diff)
downloadu-boot-a2703ce10cfcbe6a82ec8ed9ec10df2aeea08e64.tar.xz
dm: Remove uses of device_bind_offset()
This function is not needed since the standard device_bind() can be used instead. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers/pinctrl')
-rw-r--r--drivers/pinctrl/broadcom/pinctrl-bcm283x.c5
-rw-r--r--drivers/pinctrl/meson/pinctrl-meson.c4
-rw-r--r--drivers/pinctrl/mscc/pinctrl-jr2.c4
-rw-r--r--drivers/pinctrl/mscc/pinctrl-luton.c4
-rw-r--r--drivers/pinctrl/mscc/pinctrl-ocelot.c4
-rw-r--r--drivers/pinctrl/mscc/pinctrl-serval.c4
-rw-r--r--drivers/pinctrl/mscc/pinctrl-servalt.c4
-rw-r--r--drivers/pinctrl/mvebu/pinctrl-armada-37xx.c8
8 files changed, 19 insertions, 18 deletions
diff --git a/drivers/pinctrl/broadcom/pinctrl-bcm283x.c b/drivers/pinctrl/broadcom/pinctrl-bcm283x.c
index 54928a607c..5f5f3f3622 100644
--- a/drivers/pinctrl/broadcom/pinctrl-bcm283x.c
+++ b/drivers/pinctrl/broadcom/pinctrl-bcm283x.c
@@ -125,9 +125,8 @@ int bcm283x_pinctl_probe(struct udevice *dev)
struct udevice *pdev;
/* Create GPIO device as well */
- ret = device_bind_offset(dev, lists_driver_lookup_name("gpio_bcm2835"),
- "gpio_bcm2835", NULL, dev_of_offset(dev),
- &pdev);
+ ret = device_bind(dev, lists_driver_lookup_name("gpio_bcm2835"),
+ "gpio_bcm2835", NULL, dev_ofnode(dev), &pdev);
if (ret) {
/*
* While we really want the pinctrl driver to work to make
diff --git a/drivers/pinctrl/meson/pinctrl-meson.c b/drivers/pinctrl/meson/pinctrl-meson.c
index 45a1ccf58d..c35e4c42a0 100644
--- a/drivers/pinctrl/meson/pinctrl-meson.c
+++ b/drivers/pinctrl/meson/pinctrl-meson.c
@@ -347,6 +347,7 @@ int meson_pinctrl_probe(struct udevice *dev)
int na, ns;
char *name;
+ /* FIXME: Should use livetree */
na = fdt_address_cells(gd->fdt_blob, dev_of_offset(dev->parent));
if (na < 1) {
debug("bad #address-cells\n");
@@ -419,7 +420,8 @@ int meson_pinctrl_probe(struct udevice *dev)
sprintf(name, "meson-gpio");
/* Create child device UCLASS_GPIO and bind it */
- device_bind_offset(dev, priv->data->gpio_driver, name, NULL, gpio, &gpio_dev);
+ device_bind(dev, priv->data->gpio_driver, name, NULL,
+ offset_to_ofnode(gpio), &gpio_dev);
dev_set_of_offset(gpio_dev, gpio);
return 0;
diff --git a/drivers/pinctrl/mscc/pinctrl-jr2.c b/drivers/pinctrl/mscc/pinctrl-jr2.c
index fc730b79d6..6de7a416f0 100644
--- a/drivers/pinctrl/mscc/pinctrl-jr2.c
+++ b/drivers/pinctrl/mscc/pinctrl-jr2.c
@@ -299,8 +299,8 @@ static int jr2_pinctrl_probe(struct udevice *dev)
if (ret)
return ret;
- ret = device_bind_offset(dev, &jr2_gpio_driver, "jr2-gpio", NULL,
- dev_of_offset(dev), NULL);
+ ret = device_bind(dev, &jr2_gpio_driver, "jr2-gpio", NULL,
+ dev_ofnode(dev), NULL);
if (ret)
return ret;
diff --git a/drivers/pinctrl/mscc/pinctrl-luton.c b/drivers/pinctrl/mscc/pinctrl-luton.c
index 4fb17984ab..0adeef9ec6 100644
--- a/drivers/pinctrl/mscc/pinctrl-luton.c
+++ b/drivers/pinctrl/mscc/pinctrl-luton.c
@@ -165,8 +165,8 @@ int luton_pinctrl_probe(struct udevice *dev)
if (ret)
return ret;
- ret = device_bind_offset(dev, &luton_gpio_driver, "luton-gpio", NULL,
- dev_of_offset(dev), NULL);
+ ret = device_bind(dev, &luton_gpio_driver, "luton-gpio", NULL,
+ dev_ofnode(dev), NULL);
return 0;
}
diff --git a/drivers/pinctrl/mscc/pinctrl-ocelot.c b/drivers/pinctrl/mscc/pinctrl-ocelot.c
index 12ecad7a6e..4df5eef1b1 100644
--- a/drivers/pinctrl/mscc/pinctrl-ocelot.c
+++ b/drivers/pinctrl/mscc/pinctrl-ocelot.c
@@ -181,8 +181,8 @@ int ocelot_pinctrl_probe(struct udevice *dev)
if (ret)
return ret;
- ret = device_bind_offset(dev, &ocelot_gpio_driver, "ocelot-gpio", NULL,
- dev_of_offset(dev), NULL);
+ ret = device_bind(dev, &ocelot_gpio_driver, "ocelot-gpio", NULL,
+ dev_ofnode(dev), NULL);
return ret;
}
diff --git a/drivers/pinctrl/mscc/pinctrl-serval.c b/drivers/pinctrl/mscc/pinctrl-serval.c
index 93b31d2083..2cef5df3dc 100644
--- a/drivers/pinctrl/mscc/pinctrl-serval.c
+++ b/drivers/pinctrl/mscc/pinctrl-serval.c
@@ -209,8 +209,8 @@ static int serval_pinctrl_probe(struct udevice *dev)
if (ret)
return ret;
- ret = device_bind_offset(dev, &serval_gpio_driver, "serval-gpio", NULL,
- dev_of_offset(dev), NULL);
+ ret = device_bind(dev, &serval_gpio_driver, "serval-gpio", NULL,
+ dev_ofnode(dev), NULL);
if (ret)
return ret;
diff --git a/drivers/pinctrl/mscc/pinctrl-servalt.c b/drivers/pinctrl/mscc/pinctrl-servalt.c
index 9bbc7698a5..37ce52ce7b 100644
--- a/drivers/pinctrl/mscc/pinctrl-servalt.c
+++ b/drivers/pinctrl/mscc/pinctrl-servalt.c
@@ -245,8 +245,8 @@ static int servalt_pinctrl_probe(struct udevice *dev)
if (ret)
return ret;
- ret = device_bind_offset(dev, &servalt_gpio_driver, "servalt-gpio", NULL,
- dev_of_offset(dev), NULL);
+ ret = device_bind(dev, &servalt_gpio_driver, "servalt-gpio", NULL,
+ dev_ofnode(dev), NULL);
if (ret)
return ret;
diff --git a/drivers/pinctrl/mvebu/pinctrl-armada-37xx.c b/drivers/pinctrl/mvebu/pinctrl-armada-37xx.c
index 7bbeb413ba..17d7603ebd 100644
--- a/drivers/pinctrl/mvebu/pinctrl-armada-37xx.c
+++ b/drivers/pinctrl/mvebu/pinctrl-armada-37xx.c
@@ -547,13 +547,14 @@ static int armada_37xx_gpiochip_register(struct udevice *parent,
int subnode;
char *name;
- /* Lookup GPIO driver */
+ /* FIXME: Should not need to lookup GPIO uclass */
drv = lists_uclass_lookup(UCLASS_GPIO);
if (!drv) {
puts("Cannot find GPIO driver\n");
return -ENOENT;
}
+ /* FIXME: Use livtree and check the result of device_bind() below */
fdt_for_each_subnode(subnode, blob, node) {
if (fdtdec_get_bool(blob, subnode, "gpio-controller")) {
ret = 0;
@@ -567,9 +568,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_offset(parent, &armada_37xx_gpio_driver, name, NULL,
- subnode, &dev);
- dev_set_of_offset(dev, subnode);
+ device_bind(parent, &armada_37xx_gpio_driver, name, NULL,
+ offset_to_ofnode(subnode), &dev);
return 0;
}