From 45a26867e8158d0338ba5b99d21989a72d423209 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Thu, 18 May 2017 20:09:07 -0600 Subject: dm: core: Update device_bind_driver_to_node() to use ofnode Adjust this function to us an ofnode instead of an offset, so it can be used with livetree. This involves updating all callers. Signed-off-by: Simon Glass --- drivers/i2c/muxes/i2c-mux-uclass.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'drivers/i2c/muxes/i2c-mux-uclass.c') diff --git a/drivers/i2c/muxes/i2c-mux-uclass.c b/drivers/i2c/muxes/i2c-mux-uclass.c index d243b8e32d..187e8a7c91 100644 --- a/drivers/i2c/muxes/i2c-mux-uclass.c +++ b/drivers/i2c/muxes/i2c-mux-uclass.c @@ -51,24 +51,21 @@ static int i2c_mux_child_post_bind(struct udevice *dev) /* Find the I2C buses selected by this mux */ static int i2c_mux_post_bind(struct udevice *mux) { - const void *blob = gd->fdt_blob; + ofnode node; int ret; - int offset; debug("%s: %s\n", __func__, mux->name); /* * There is no compatible string in the sub-nodes, so we must manually * bind these */ - for (offset = fdt_first_subnode(blob, dev_of_offset(mux)); - offset > 0; - offset = fdt_next_subnode(blob, offset)) { + dev_for_each_subnode(node, mux) { struct udevice *dev; const char *name; - name = fdt_get_name(blob, offset, NULL); + name = ofnode_get_name(node); ret = device_bind_driver_to_node(mux, "i2c_mux_bus_drv", name, - offset, &dev); + node, &dev); debug(" - bind ret=%d, %s\n", ret, dev ? dev->name : NULL); if (ret) return ret; -- cgit