diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/clk/clk-uclass.c | 6 | ||||
-rw-r--r-- | drivers/core/device.c | 2 | ||||
-rw-r--r-- | drivers/gpio/dwapb_gpio.c | 3 | ||||
-rw-r--r-- | drivers/i2c/mxc_i2c.c | 2 | ||||
-rw-r--r-- | drivers/mailbox/mailbox-uclass.c | 6 | ||||
-rw-r--r-- | drivers/net/cpsw.c | 2 | ||||
-rw-r--r-- | drivers/net/keystone_net.c | 4 | ||||
-rw-r--r-- | drivers/net/mvpp2.c | 2 | ||||
-rw-r--r-- | drivers/net/sun8i_emac.c | 5 | ||||
-rw-r--r-- | drivers/pci/pci_tegra.c | 2 | ||||
-rw-r--r-- | drivers/phy/marvell/comphy_core.c | 2 | ||||
-rw-r--r-- | drivers/pinctrl/exynos/pinctrl-exynos.c | 9 | ||||
-rw-r--r-- | drivers/pinctrl/meson/pinctrl-meson.c | 4 | ||||
-rw-r--r-- | drivers/pinctrl/pinctrl-generic.c | 10 | ||||
-rw-r--r-- | drivers/pinctrl/pinctrl-uclass.c | 2 | ||||
-rw-r--r-- | drivers/power/pmic/palmas.c | 2 | ||||
-rw-r--r-- | drivers/reset/reset-uclass.c | 6 | ||||
-rw-r--r-- | drivers/spi/fsl_qspi.c | 2 | ||||
-rw-r--r-- | drivers/video/sunxi_display.c | 2 |
19 files changed, 37 insertions, 36 deletions
diff --git a/drivers/clk/clk-uclass.c b/drivers/clk/clk-uclass.c index 4d78e3f..c42fff6 100644 --- a/drivers/clk/clk-uclass.c +++ b/drivers/clk/clk-uclass.c @@ -101,10 +101,10 @@ int clk_get_by_name(struct udevice *dev, const char *name, struct clk *clk) debug("%s(dev=%p, name=%s, clk=%p)\n", __func__, dev, name, clk); - index = fdt_find_string(gd->fdt_blob, dev->of_offset, "clock-names", - name); + index = fdt_stringlist_search(gd->fdt_blob, dev->of_offset, + "clock-names", name); if (index < 0) { - debug("fdt_find_string() failed: %d\n", index); + debug("fdt_stringlist_search() failed: %d\n", index); return index; } diff --git a/drivers/core/device.c b/drivers/core/device.c index b737f1c..1935b8d 100644 --- a/drivers/core/device.c +++ b/drivers/core/device.c @@ -698,7 +698,7 @@ fdt_addr_t dev_get_addr_name(struct udevice *dev, const char *name) #if CONFIG_IS_ENABLED(OF_CONTROL) int index; - index = fdt_find_string(gd->fdt_blob, dev->of_offset, "reg-names", + index = fdt_stringlist_search(gd->fdt_blob, dev->of_offset, "reg-names", name); if (index < 0) return index; diff --git a/drivers/gpio/dwapb_gpio.c b/drivers/gpio/dwapb_gpio.c index 72cec48..471e18a 100644 --- a/drivers/gpio/dwapb_gpio.c +++ b/drivers/gpio/dwapb_gpio.c @@ -132,7 +132,8 @@ static int gpio_dwapb_bind(struct udevice *dev) plat->base = base; plat->bank = bank; plat->pins = fdtdec_get_int(blob, node, "snps,nr-gpios", 0); - ret = fdt_get_string(blob, node, "bank-name", &plat->name); + plat->name = fdt_stringlist_get(blob, node, "bank-name", 0, + NULL); if (ret) goto err; diff --git a/drivers/i2c/mxc_i2c.c b/drivers/i2c/mxc_i2c.c index a26f44e..6247d33 100644 --- a/drivers/i2c/mxc_i2c.c +++ b/drivers/i2c/mxc_i2c.c @@ -773,7 +773,7 @@ static int mxc_i2c_probe(struct udevice *bus) * See Documentation/devicetree/bindings/i2c/i2c-imx.txt * Use gpio to force bus idle when necessary. */ - ret = fdt_find_string(fdt, node, "pinctrl-names", "gpio"); + ret = fdt_stringlist_search(fdt, node, "pinctrl-names", "gpio"); if (ret < 0) { dev_info(dev, "i2c bus %d at %lu, no gpio pinctrl state.\n", bus->seq, i2c_bus->base); } else { diff --git a/drivers/mailbox/mailbox-uclass.c b/drivers/mailbox/mailbox-uclass.c index 40f851d..a7fcde5 100644 --- a/drivers/mailbox/mailbox-uclass.c +++ b/drivers/mailbox/mailbox-uclass.c @@ -85,10 +85,10 @@ int mbox_get_by_name(struct udevice *dev, const char *name, debug("%s(dev=%p, name=%s, chan=%p)\n", __func__, dev, name, chan); - index = fdt_find_string(gd->fdt_blob, dev->of_offset, "mbox-names", - name); + index = fdt_stringlist_search(gd->fdt_blob, dev->of_offset, + "mbox-names", name); if (index < 0) { - debug("fdt_find_string() failed: %d\n", index); + debug("fdt_stringlist_search() failed: %d\n", index); return index; } diff --git a/drivers/net/cpsw.c b/drivers/net/cpsw.c index d1f024e..cbce683 100644 --- a/drivers/net/cpsw.c +++ b/drivers/net/cpsw.c @@ -1348,7 +1348,7 @@ static int cpsw_eth_ofdata_to_platdata(struct udevice *dev) active_slave = fdtdec_get_int(fdt, node, "active_slave", 0); priv->data.active_slave = active_slave; - fdt_for_each_subnode(fdt, subnode, node) { + fdt_for_each_subnode(subnode, fdt, node) { int len; const char *name; diff --git a/drivers/net/keystone_net.c b/drivers/net/keystone_net.c index e41b7d1..f88d83e 100644 --- a/drivers/net/keystone_net.c +++ b/drivers/net/keystone_net.c @@ -990,7 +990,7 @@ static int ks2_eth_bind_slaves(struct udevice *dev, int gbe, int *gbe_0) char *slave_name; interfaces = fdt_subnode_offset(fdt, gbe, "interfaces"); - fdt_for_each_subnode(fdt, slave, interfaces) { + fdt_for_each_subnode(slave, fdt, interfaces) { int slave_no; slave_no = fdtdec_get_int(fdt, slave, "slave-port", -ENOENT); @@ -1015,7 +1015,7 @@ static int ks2_eth_bind_slaves(struct udevice *dev, int gbe, int *gbe_0) } sec_slave = fdt_subnode_offset(fdt, gbe, "secondary-slave-ports"); - fdt_for_each_subnode(fdt, slave, sec_slave) { + fdt_for_each_subnode(slave, fdt, sec_slave) { int slave_no; slave_no = fdtdec_get_int(fdt, slave, "slave-port", -ENOENT); diff --git a/drivers/net/mvpp2.c b/drivers/net/mvpp2.c index 340b85a..405776a 100644 --- a/drivers/net/mvpp2.c +++ b/drivers/net/mvpp2.c @@ -4153,7 +4153,7 @@ static int mvpp2_base_bind(struct udevice *parent) return -ENOENT; } - fdt_for_each_subnode(blob, subnode, node) { + fdt_for_each_subnode(subnode, blob, node) { /* Skip disabled ports */ if (!fdtdec_get_is_enabled(blob, subnode)) continue; diff --git a/drivers/net/sun8i_emac.c b/drivers/net/sun8i_emac.c index 4c149e1..91570a2 100644 --- a/drivers/net/sun8i_emac.c +++ b/drivers/net/sun8i_emac.c @@ -456,8 +456,9 @@ static int parse_phy_pins(struct udevice *dev) for (i = 0; ; i++) { int pin; - if (fdt_get_string_index(gd->fdt_blob, offset, - "allwinner,pins", i, &pin_name)) + pin_name = fdt_stringlist_get(gd->fdt_blob, offset, + "allwinner,pins", i, NULL); + if (!pin_name) break; if (pin_name[0] != 'P') continue; diff --git a/drivers/pci/pci_tegra.c b/drivers/pci/pci_tegra.c index ea8adb98..430270e 100644 --- a/drivers/pci/pci_tegra.c +++ b/drivers/pci/pci_tegra.c @@ -531,7 +531,7 @@ static int tegra_pcie_parse_dt(const void *fdt, int node, enum tegra_pci_id id, } #endif - fdt_for_each_subnode(fdt, subnode, node) { + fdt_for_each_subnode(subnode, fdt, node) { unsigned int index = 0, num_lanes = 0; struct tegra_pcie_port *port; diff --git a/drivers/phy/marvell/comphy_core.c b/drivers/phy/marvell/comphy_core.c index 344df3b..651397d 100644 --- a/drivers/phy/marvell/comphy_core.c +++ b/drivers/phy/marvell/comphy_core.c @@ -152,7 +152,7 @@ static int comphy_probe(struct udevice *dev) } lane = 0; - fdt_for_each_subnode(blob, subnode, node) { + fdt_for_each_subnode(subnode, blob, node) { /* Skip disabled ports */ if (!fdtdec_get_is_enabled(blob, subnode)) continue; diff --git a/drivers/pinctrl/exynos/pinctrl-exynos.c b/drivers/pinctrl/exynos/pinctrl-exynos.c index a28405f..c9c13e6 100644 --- a/drivers/pinctrl/exynos/pinctrl-exynos.c +++ b/drivers/pinctrl/exynos/pinctrl-exynos.c @@ -71,7 +71,7 @@ int exynos_pinctrl_set_state(struct udevice *dev, struct udevice *config) { const void *fdt = gd->fdt_blob; int node = config->of_offset; - unsigned int count, idx, pin_num, ret; + unsigned int count, idx, pin_num; unsigned int pinfunc, pinpud, pindrv; unsigned long reg, value; const char *name; @@ -80,7 +80,7 @@ int exynos_pinctrl_set_state(struct udevice *dev, struct udevice *config) * refer to the following document for the pinctrl bindings * linux/Documentation/devicetree/bindings/pinctrl/samsung-pinctrl.txt */ - count = fdt_count_strings(fdt, node, "samsung,pins"); + count = fdt_stringlist_count(fdt, node, "samsung,pins"); if (count <= 0) return -EINVAL; @@ -89,9 +89,8 @@ int exynos_pinctrl_set_state(struct udevice *dev, struct udevice *config) pindrv = fdtdec_get_int(fdt, node, "samsung,pin-drv", -1); for (idx = 0; idx < count; idx++) { - ret = fdt_get_string_index(fdt, node, "samsung,pins", - idx, &name); - if (ret < 0) + name = fdt_stringlist_get(fdt, node, "samsung,pins", idx, NULL); + if (!name) continue; reg = pin_to_bank_base(dev, name, &pin_num); diff --git a/drivers/pinctrl/meson/pinctrl-meson.c b/drivers/pinctrl/meson/pinctrl-meson.c index d21a3dd..30f7cfc 100644 --- a/drivers/pinctrl/meson/pinctrl-meson.c +++ b/drivers/pinctrl/meson/pinctrl-meson.c @@ -122,7 +122,7 @@ static fdt_addr_t parse_address(int offset, const char *name, int na, int ns) int index, len = 0; const fdt32_t *reg; - index = fdt_find_string(gd->fdt_blob, offset, "reg-names", name); + index = fdt_stringlist_search(gd->fdt_blob, offset, "reg-names", name); if (index < 0) return FDT_ADDR_T_NONE; @@ -154,7 +154,7 @@ int meson_pinctrl_probe(struct udevice *dev) return -EINVAL; } - fdt_for_each_subnode(gd->fdt_blob, node, dev->of_offset) { + fdt_for_each_subnode(node, gd->fdt_blob, dev->of_offset) { if (fdt_getprop(gd->fdt_blob, node, "gpio-controller", &len)) { gpio = node; break; diff --git a/drivers/pinctrl/pinctrl-generic.c b/drivers/pinctrl/pinctrl-generic.c index baff40f..482db29 100644 --- a/drivers/pinctrl/pinctrl-generic.c +++ b/drivers/pinctrl/pinctrl-generic.c @@ -306,11 +306,11 @@ static int pinctrl_generic_set_state_subnode(struct udevice *dev, const char *name; int strings_count, selector, i, ret; - strings_count = fdt_count_strings(fdt, node, subnode_target_type); + strings_count = fdt_stringlist_count(fdt, node, subnode_target_type); if (strings_count < 0) { subnode_target_type = "groups"; is_group = true; - strings_count = fdt_count_strings(fdt, node, + strings_count = fdt_stringlist_count(fdt, node, subnode_target_type); if (strings_count < 0) { /* skip this node; may contain config child nodes */ @@ -319,9 +319,9 @@ static int pinctrl_generic_set_state_subnode(struct udevice *dev, } for (i = 0; i < strings_count; i++) { - ret = fdt_get_string_index(fdt, node, subnode_target_type, - i, &name); - if (ret < 0) + name = fdt_stringlist_get(fdt, node, subnode_target_type, i, + NULL); + if (!name) return -EINVAL; if (is_group) diff --git a/drivers/pinctrl/pinctrl-uclass.c b/drivers/pinctrl/pinctrl-uclass.c index 7397de2..02ab9b4 100644 --- a/drivers/pinctrl/pinctrl-uclass.c +++ b/drivers/pinctrl/pinctrl-uclass.c @@ -72,7 +72,7 @@ static int pinctrl_select_state_full(struct udevice *dev, const char *statename) struct udevice *config; int state, size, i, ret; - state = fdt_find_string(fdt, node, "pinctrl-names", statename); + state = fdt_stringlist_search(fdt, node, "pinctrl-names", statename); if (state < 0) { char *end; /* diff --git a/drivers/power/pmic/palmas.c b/drivers/power/pmic/palmas.c index 6c79a93..0ab425e 100644 --- a/drivers/power/pmic/palmas.c +++ b/drivers/power/pmic/palmas.c @@ -52,7 +52,7 @@ static int palmas_bind(struct udevice *dev) int node = dev->of_offset; int subnode, len; - fdt_for_each_subnode(blob, subnode, node) { + fdt_for_each_subnode(subnode, blob, node) { const char *name; char *temp; diff --git a/drivers/reset/reset-uclass.c b/drivers/reset/reset-uclass.c index edaecfb..d3744ef 100644 --- a/drivers/reset/reset-uclass.c +++ b/drivers/reset/reset-uclass.c @@ -88,10 +88,10 @@ int reset_get_by_name(struct udevice *dev, const char *name, debug("%s(dev=%p, name=%s, reset_ctl=%p)\n", __func__, dev, name, reset_ctl); - index = fdt_find_string(gd->fdt_blob, dev->of_offset, "reset-names", - name); + index = fdt_stringlist_search(gd->fdt_blob, dev->of_offset, + "reset-names", name); if (index < 0) { - debug("fdt_find_string() failed: %d\n", index); + debug("fdt_stringlist_search() failed: %d\n", index); return index; } diff --git a/drivers/spi/fsl_qspi.c b/drivers/spi/fsl_qspi.c index 729ded9..4d378c2 100644 --- a/drivers/spi/fsl_qspi.c +++ b/drivers/spi/fsl_qspi.c @@ -1098,7 +1098,7 @@ static int fsl_qspi_ofdata_to_platdata(struct udevice *bus) } /* Count flash numbers */ - fdt_for_each_subnode(blob, subnode, node) + fdt_for_each_subnode(subnode, blob, node) ++flash_num; if (flash_num == 0) { diff --git a/drivers/video/sunxi_display.c b/drivers/video/sunxi_display.c index 50b16a9..6cba1b9 100644 --- a/drivers/video/sunxi_display.c +++ b/drivers/video/sunxi_display.c @@ -1562,7 +1562,7 @@ int sunxi_simplefb_setup(void *blob) offset = fdt_node_offset_by_compatible(blob, -1, "allwinner,simple-framebuffer"); while (offset >= 0) { - ret = fdt_find_string(blob, offset, "allwinner,pipeline", + ret = fdt_stringlist_search(blob, offset, "allwinner,pipeline", pipeline); if (ret == 0) break; |