summaryrefslogtreecommitdiff
path: root/drivers/pinctrl/exynos/pinctrl-exynos.c
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2016-10-02 17:59:28 -0600
committerSimon Glass <sjg@chromium.org>2016-10-13 13:54:10 -0600
commitb02e4044ff8ee1f6ac83917a39514172a9b449fb (patch)
treed8f1e23e27364854c39a6592958382d5bdc1ef62 /drivers/pinctrl/exynos/pinctrl-exynos.c
parent9c07b9877cf07a1a971a79ed7c2369a58c0baca2 (diff)
downloadu-boot-imx-b02e4044ff8ee1f6ac83917a39514172a9b449fb.zip
u-boot-imx-b02e4044ff8ee1f6ac83917a39514172a9b449fb.tar.gz
u-boot-imx-b02e4044ff8ee1f6ac83917a39514172a9b449fb.tar.bz2
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 'drivers/pinctrl/exynos/pinctrl-exynos.c')
-rw-r--r--drivers/pinctrl/exynos/pinctrl-exynos.c9
1 files changed, 4 insertions, 5 deletions
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);