diff options
author | Simon Glass <sjg@chromium.org> | 2016-10-02 17:59:28 -0600 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2016-10-13 13:54:10 -0600 |
commit | b02e4044ff8ee1f6ac83917a39514172a9b449fb (patch) | |
tree | d8f1e23e27364854c39a6592958382d5bdc1ef62 /arch | |
parent | 9c07b9877cf07a1a971a79ed7c2369a58c0baca2 (diff) | |
download | u-boot-b02e4044ff8ee1f6ac83917a39514172a9b449fb.tar.gz |
libfdt: Bring in upstream stringlist functions
These have now landed upstream. The naming is different and in one case the
function signature has changed. Update the code to match.
This applies the following upstream commits by
Thierry Reding <treding@nvidia.com> :
604e61e fdt: Add functions to retrieve strings
8702bd1 fdt: Add a function to get the index of a string
2218387 fdt: Add a function to count strings
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/mach-tegra/xusb-padctl-common.c | 14 | ||||
-rw-r--r-- | arch/arm/mach-uniphier/board_late_init.c | 5 | ||||
-rw-r--r-- | arch/x86/cpu/irq.c | 5 |
3 files changed, 12 insertions, 12 deletions
diff --git a/arch/arm/mach-tegra/xusb-padctl-common.c b/arch/arm/mach-tegra/xusb-padctl-common.c index 18ad7bfbdc..6867065790 100644 --- a/arch/arm/mach-tegra/xusb-padctl-common.c +++ b/arch/arm/mach-tegra/xusb-padctl-common.c @@ -78,11 +78,11 @@ tegra_xusb_padctl_group_parse_dt(struct tegra_xusb_padctl *padctl, const void *fdt, int node) { unsigned int i; - int len, err; + int len; group->name = fdt_get_name(fdt, node, &len); - len = fdt_count_strings(fdt, node, "nvidia,lanes"); + len = fdt_stringlist_count(fdt, node, "nvidia,lanes"); if (len < 0) { error("failed to parse \"nvidia,lanes\" property"); return -EINVAL; @@ -91,9 +91,9 @@ tegra_xusb_padctl_group_parse_dt(struct tegra_xusb_padctl *padctl, group->num_pins = len; for (i = 0; i < group->num_pins; i++) { - err = fdt_get_string_index(fdt, node, "nvidia,lanes", i, - &group->pins[i]); - if (err < 0) { + group->pins[i] = fdt_stringlist_get(fdt, node, "nvidia,lanes", + i, NULL); + if (!group->pins[i]) { error("failed to read string from \"nvidia,lanes\" property"); return -EINVAL; } @@ -101,8 +101,8 @@ tegra_xusb_padctl_group_parse_dt(struct tegra_xusb_padctl *padctl, group->num_pins = len; - err = fdt_get_string(fdt, node, "nvidia,function", &group->func); - if (err < 0) { + group->func = fdt_stringlist_get(fdt, node, "nvidia,function", 0, NULL); + if (!group->func) { error("failed to parse \"nvidia,func\" property"); return -EINVAL; } diff --git a/arch/arm/mach-uniphier/board_late_init.c b/arch/arm/mach-uniphier/board_late_init.c index a45412677a..f23295fbd2 100644 --- a/arch/arm/mach-uniphier/board_late_init.c +++ b/arch/arm/mach-uniphier/board_late_init.c @@ -37,13 +37,12 @@ static int uniphier_set_fdt_file(void) const char *compat; char dtb_name[256]; int buf_len = 256; - int ret; if (getenv("fdt_file")) return 0; /* do nothing if it is already set */ - ret = fdt_get_string(gd->fdt_blob, 0, "compatible", &compat); - if (ret) + compat = fdt_stringlist_get(gd->fdt_blob, 0, "compatible", 0, NULL); + if (!compat) return -EINVAL; if (strncmp(compat, VENDOR_PREFIX, strlen(VENDOR_PREFIX))) diff --git a/arch/x86/cpu/irq.c b/arch/x86/cpu/irq.c index df3cd0abc7..9364410a0f 100644 --- a/arch/x86/cpu/irq.c +++ b/arch/x86/cpu/irq.c @@ -103,11 +103,12 @@ static int create_pirq_routing_table(struct udevice *dev) /* extract the bdf from fdt_pci_addr */ priv->bdf = dm_pci_get_bdf(dev->parent); - ret = fdt_find_string(blob, node, "intel,pirq-config", "pci"); + ret = fdt_stringlist_search(blob, node, "intel,pirq-config", "pci"); if (!ret) { priv->config = PIRQ_VIA_PCI; } else { - ret = fdt_find_string(blob, node, "intel,pirq-config", "ibase"); + ret = fdt_stringlist_search(blob, node, "intel,pirq-config", + "ibase"); if (!ret) priv->config = PIRQ_VIA_IBASE; else |