[PATCH 05/11] dm: Drop uses of dev_set_of_offset()
Simon Glass
sjg at chromium.org
Sun Nov 29 01:50:04 CET 2020
The need for this can be avoided by passing the correct node to the
device_bind() function.
Signed-off-by: Simon Glass <sjg at chromium.org>
---
drivers/gpio/mt7621_gpio.c | 3 +--
drivers/gpio/s5p_gpio.c | 4 +---
drivers/gpio/sunxi_gpio.c | 3 +--
drivers/gpio/tegra186_gpio.c | 3 +--
drivers/gpio/tegra_gpio.c | 5 ++---
drivers/pinctrl/meson/pinctrl-meson.c | 1 -
6 files changed, 6 insertions(+), 13 deletions(-)
diff --git a/drivers/gpio/mt7621_gpio.c b/drivers/gpio/mt7621_gpio.c
index 8b41e34844e..ea51291e237 100644
--- a/drivers/gpio/mt7621_gpio.c
+++ b/drivers/gpio/mt7621_gpio.c
@@ -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++;
}
diff --git a/drivers/gpio/s5p_gpio.c b/drivers/gpio/s5p_gpio.c
index d6054c4a6dd..ec8d54922d3 100644
--- a/drivers/gpio/s5p_gpio.c
+++ b/drivers/gpio/s5p_gpio.c
@@ -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);
diff --git a/drivers/gpio/sunxi_gpio.c b/drivers/gpio/sunxi_gpio.c
index b6b0e9acbdb..dea71a7f340 100644
--- a/drivers/gpio/sunxi_gpio.c
+++ b/drivers/gpio/sunxi_gpio.c
@@ -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;
diff --git a/drivers/gpio/tegra186_gpio.c b/drivers/gpio/tegra186_gpio.c
index bcc322c3b02..ad97e13a1cb 100644
--- a/drivers/gpio/tegra186_gpio.c
+++ b/drivers/gpio/tegra186_gpio.c
@@ -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;
diff --git a/drivers/gpio/tegra_gpio.c b/drivers/gpio/tegra_gpio.c
index 3877ee659af..22d25313227 100644
--- a/drivers/gpio/tegra_gpio.c
+++ b/drivers/gpio/tegra_gpio.c
@@ -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));
}
}
diff --git a/drivers/pinctrl/meson/pinctrl-meson.c b/drivers/pinctrl/meson/pinctrl-meson.c
index c35e4c42a09..37bddb14e08 100644
--- a/drivers/pinctrl/meson/pinctrl-meson.c
+++ b/drivers/pinctrl/meson/pinctrl-meson.c
@@ -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;
}
--
2.29.2.454.gaff20da3a2-goog
More information about the U-Boot
mailing list