pinctrl: Convert to using %pOF instead of full_name
authorRob Herring <robh@kernel.org>
Tue, 18 Jul 2017 21:43:23 +0000 (16:43 -0500)
committerLinus Walleij <linus.walleij@linaro.org>
Mon, 14 Aug 2017 13:01:02 +0000 (15:01 +0200)
Now that we have a custom printf format specifier, convert users of
full_name to use %pOF instead. This is preparation to remove storing
of the full path string for each node.

Signed-off-by: Rob Herring <robh@kernel.org>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Lee Jones <lee@kernel.org>
Cc: Stefan Wahren <stefan.wahren@i2se.com>
Cc: Florian Fainelli <f.fainelli@gmail.com>
Cc: Ray Jui <rjui@broadcom.com>
Cc: Scott Branden <sbranden@broadcom.com>
Cc: bcm-kernel-feedback-list@broadcom.com
Cc: Tomasz Figa <tomasz.figa@gmail.com>
Cc: Sylwester Nawrocki <s.nawrocki@samsung.com>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Barry Song <baohua@kernel.org>
Cc: linux-gpio@vger.kernel.org
Cc: linux-rpi-kernel@lists.infradead.org
Cc: linux-arm-kernel@lists.infradead.org
Cc: kernel@stlinux.com
Cc: linux-samsung-soc@vger.kernel.org
Cc: linux-renesas-soc@vger.kernel.org
Acked-by: Krzysztof Kozlowski <krzk@kernel.org>
Acked-by: Ludovic Desroches <ludovic.desroches@microchip.com>
Acked-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Acked-by: Geert Uytterhoeven <geert+renesas@glider.be>
Acked-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/pinctrl/bcm/pinctrl-bcm2835.c
drivers/pinctrl/devicetree.c
drivers/pinctrl/freescale/pinctrl-imx.c
drivers/pinctrl/pinconf-generic.c
drivers/pinctrl/pinctrl-at91-pio4.c
drivers/pinctrl/pinctrl-st.c
drivers/pinctrl/pinctrl-tb10x.c
drivers/pinctrl/samsung/pinctrl-samsung.c
drivers/pinctrl/sh-pfc/pinctrl.c
drivers/pinctrl/sirf/pinctrl-sirf.c

index 7203f35a2680d71efc4140474e80a59cc3c1ca63..7b7bd26f704aa2c3e5c10ff998a14f756d7d2d59 100644 (file)
@@ -692,8 +692,7 @@ static int bcm2835_pctl_dt_node_to_map_func(struct bcm2835_pinctrl *pc,
        struct pinctrl_map *map = *maps;
 
        if (fnum >= ARRAY_SIZE(bcm2835_functions)) {
-               dev_err(pc->dev, "%s: invalid brcm,function %d\n",
-                       of_node_full_name(np), fnum);
+               dev_err(pc->dev, "%pOF: invalid brcm,function %d\n", np, fnum);
                return -EINVAL;
        }
 
@@ -713,8 +712,7 @@ static int bcm2835_pctl_dt_node_to_map_pull(struct bcm2835_pinctrl *pc,
        unsigned long *configs;
 
        if (pull > 2) {
-               dev_err(pc->dev, "%s: invalid brcm,pull %d\n",
-                       of_node_full_name(np), pull);
+               dev_err(pc->dev, "%pOF: invalid brcm,pull %d\n", np, pull);
                return -EINVAL;
        }
 
@@ -745,8 +743,7 @@ static int bcm2835_pctl_dt_node_to_map(struct pinctrl_dev *pctldev,
 
        pins = of_find_property(np, "brcm,pins", NULL);
        if (!pins) {
-               dev_err(pc->dev, "%s: missing brcm,pins property\n",
-                               of_node_full_name(np));
+               dev_err(pc->dev, "%pOF: missing brcm,pins property\n", np);
                return -EINVAL;
        }
 
@@ -755,8 +752,8 @@ static int bcm2835_pctl_dt_node_to_map(struct pinctrl_dev *pctldev,
 
        if (!funcs && !pulls) {
                dev_err(pc->dev,
-                       "%s: neither brcm,function nor brcm,pull specified\n",
-                       of_node_full_name(np));
+                       "%pOF: neither brcm,function nor brcm,pull specified\n",
+                       np);
                return -EINVAL;
        }
 
@@ -766,15 +763,15 @@ static int bcm2835_pctl_dt_node_to_map(struct pinctrl_dev *pctldev,
 
        if (num_funcs > 1 && num_funcs != num_pins) {
                dev_err(pc->dev,
-                       "%s: brcm,function must have 1 or %d entries\n",
-                       of_node_full_name(np), num_pins);
+                       "%pOF: brcm,function must have 1 or %d entries\n",
+                       np, num_pins);
                return -EINVAL;
        }
 
        if (num_pulls > 1 && num_pulls != num_pins) {
                dev_err(pc->dev,
-                       "%s: brcm,pull must have 1 or %d entries\n",
-                       of_node_full_name(np), num_pins);
+                       "%pOF: brcm,pull must have 1 or %d entries\n",
+                       np, num_pins);
                return -EINVAL;
        }
 
@@ -793,8 +790,8 @@ static int bcm2835_pctl_dt_node_to_map(struct pinctrl_dev *pctldev,
                if (err)
                        goto out;
                if (pin >= ARRAY_SIZE(bcm2835_gpio_pins)) {
-                       dev_err(pc->dev, "%s: invalid brcm,pins value %d\n",
-                               of_node_full_name(np), pin);
+                       dev_err(pc->dev, "%pOF: invalid brcm,pins value %d\n",
+                               np, pin);
                        err = -EINVAL;
                        goto out;
                }
index 0e5c9f14a706e6f25cceeccecc0e67527e7051aa..0a20afc2210cf3483cbb899302fb7441a2261e0c 100644 (file)
@@ -117,8 +117,8 @@ static int dt_to_map_one_config(struct pinctrl *p,
        for (;;) {
                np_pctldev = of_get_next_parent(np_pctldev);
                if (!np_pctldev || of_node_is_root(np_pctldev)) {
-                       dev_info(p->dev, "could not find pctldev for node %s, deferring probe\n",
-                               np_config->full_name);
+                       dev_info(p->dev, "could not find pctldev for node %pOF, deferring probe\n",
+                               np_config);
                        of_node_put(np_pctldev);
                        /* OK let's just assume this will appear later then */
                        return -EPROBE_DEFER;
index ad23e396da8162906d483f517182f84c87be3eb5..6e472691d8eed6f0d3a71d20fe8e6e7e939d5b7d 100644 (file)
@@ -461,16 +461,14 @@ static int imx_pinctrl_parse_groups(struct device_node *np,
                list = of_get_property(np, "pinmux", &size);
                if (!list) {
                        dev_err(info->dev,
-                               "no fsl,pins and pins property in node %s\n",
-                               np->full_name);
+                               "no fsl,pins and pins property in node %pOF\n", np);
                        return -EINVAL;
                }
        }
 
        /* we do not check return since it's safe node passed down */
        if (!size || size % pin_size) {
-               dev_err(info->dev, "Invalid fsl,pins or pins property in node %s\n",
-                       np->full_name);
+               dev_err(info->dev, "Invalid fsl,pins or pins property in node %pOF\n", np);
                return -EINVAL;
        }
 
@@ -554,7 +552,7 @@ static int imx_pinctrl_parse_functions(struct device_node *np,
        func->name = np->name;
        func->num_group_names = of_get_child_count(np);
        if (func->num_group_names == 0) {
-               dev_err(info->dev, "no groups defined in %s\n", np->full_name);
+               dev_err(info->dev, "no groups defined in %pOF\n", np);
                return -EINVAL;
        }
        func->group_names = devm_kcalloc(info->dev, func->num_group_names,
index fc0c230aa11f390f15aa416d0b38f7c411bd98ad..4cf901c781300fad3d0ca65f8f47503b9b7094d5 100644 (file)
@@ -316,16 +316,15 @@ int pinconf_generic_dt_subnode_to_map(struct pinctrl_dev *pctldev,
        if (ret < 0) {
                /* EINVAL=missing, which is fine since it's optional */
                if (ret != -EINVAL)
-                       dev_err(dev, "%s: could not parse property function\n",
-                               of_node_full_name(np));
+                       dev_err(dev, "%pOF: could not parse property function\n",
+                               np);
                function = NULL;
        }
 
        ret = pinconf_generic_parse_dt_config(np, pctldev, &configs,
                                              &num_configs);
        if (ret < 0) {
-               dev_err(dev, "%s: could not parse node property\n",
-                       of_node_full_name(np));
+               dev_err(dev, "%pOF: could not parse node property\n", np);
                return ret;
        }
 
index dc8591543deede05dda815d3dbaf654e31b5b798..b1ca838dd80a1c2843083b9c16d532be6ce5d40d 100644 (file)
@@ -494,8 +494,8 @@ static int atmel_pctl_dt_subnode_to_map(struct pinctrl_dev *pctldev,
        ret = pinconf_generic_parse_dt_config(np, pctldev, &configs,
                                              &num_configs);
        if (ret < 0) {
-               dev_err(pctldev->dev, "%s: could not parse node property\n",
-                       of_node_full_name(np));
+               dev_err(pctldev->dev, "%pOF: could not parse node property\n",
+                       np);
                return ret;
        }
 
@@ -504,8 +504,7 @@ static int atmel_pctl_dt_subnode_to_map(struct pinctrl_dev *pctldev,
 
        num_pins = pins->length / sizeof(u32);
        if (!num_pins) {
-               dev_err(pctldev->dev, "no pins found in node %s\n",
-                       of_node_full_name(np));
+               dev_err(pctldev->dev, "no pins found in node %pOF\n", np);
                ret = -EINVAL;
                goto exit;
        }
@@ -584,8 +583,8 @@ static int atmel_pctl_dt_node_to_map(struct pinctrl_dev *pctldev,
 
        if (ret < 0) {
                pinctrl_utils_free_map(pctldev, *map, *num_maps);
-               dev_err(pctldev->dev, "can't create maps for node %s\n",
-                       np_config->full_name);
+               dev_err(pctldev->dev, "can't create maps for node %pOF\n",
+                       np_config);
        }
 
        return ret;
index 5d4789daf396cac1d5891381737ee645fb480e84..7ac8b1e033fe405ef55478c36bf0dff75164302b 100644 (file)
@@ -1537,7 +1537,7 @@ static int st_gpiolib_register_bank(struct st_pinctrl *info,
                        return err;
                }
        } else {
-               dev_info(dev, "No IRQ support for %s bank\n", np->full_name);
+               dev_info(dev, "No IRQ support for %pOF bank\n", np);
        }
 
        return 0;
index edfba506e95825fe450f97280d5de066fa654e67..09d35006acb2599d530a9d257e39dddd21fce90f 100644 (file)
@@ -557,8 +557,8 @@ static int tb10x_dt_node_to_map(struct pinctrl_dev *pctl,
        int ret = 0;
 
        if (of_property_read_string(np_config, "abilis,function", &string)) {
-               pr_err("%s: No abilis,function property in device tree.\n",
-                       np_config->full_name);
+               pr_err("%pOF: No abilis,function property in device tree.\n",
+                       np_config);
                return -EINVAL;
        }
 
index f542642eed8dd2106d169c0f6a26a4426521db14..20b59bb02196b5d594a0787f543e37bea66239a1 100644 (file)
@@ -679,7 +679,7 @@ static int samsung_pinctrl_create_function(struct device *dev,
 
        npins = of_property_count_strings(func_np, "samsung,pins");
        if (npins < 1) {
-               dev_err(dev, "invalid pin list in %s node", func_np->name);
+               dev_err(dev, "invalid pin list in %pOFn node", func_np);
                return -EINVAL;
        }
 
@@ -696,8 +696,8 @@ static int samsung_pinctrl_create_function(struct device *dev,
                                                        i, &gname);
                if (ret) {
                        dev_err(dev,
-                               "failed to read pin name %d from %s node\n",
-                               i, func_np->name);
+                               "failed to read pin name %d from %pOFn node\n",
+                               i, func_np);
                        return ret;
                }
 
index a70157f0acf4ecf7b55fb89a8bb346b537bb1903..e7a92eec06c2845b11d061bc29948a6bacb298fd 100644 (file)
@@ -290,7 +290,7 @@ static int sh_pfc_dt_node_to_map(struct pinctrl_dev *pctldev,
        if (*num_maps)
                return 0;
 
-       dev_err(dev, "no mapping found in node %s\n", np->full_name);
+       dev_err(dev, "no mapping found in node %pOF\n", np);
        ret = -EINVAL;
 
 done:
index 0df72be60704809dccf7a7bf23c4c993e3c4ea0b..80bfd47191992a938665b1b644234117282333a2 100644 (file)
@@ -810,7 +810,7 @@ static int sirfsoc_gpio_probe(struct device_node *np)
        sgpio->chip.gc.set = sirfsoc_gpio_set_value;
        sgpio->chip.gc.base = 0;
        sgpio->chip.gc.ngpio = SIRFSOC_GPIO_BANK_SIZE * SIRFSOC_GPIO_NO_OF_BANKS;
-       sgpio->chip.gc.label = kstrdup(np->full_name, GFP_KERNEL);
+       sgpio->chip.gc.label = kasprintf(GFP_KERNEL, "%pOF", np);
        sgpio->chip.gc.of_node = np;
        sgpio->chip.gc.of_xlate = sirfsoc_gpio_of_xlate;
        sgpio->chip.gc.of_gpio_n_cells = 2;
@@ -819,8 +819,8 @@ static int sirfsoc_gpio_probe(struct device_node *np)
 
        err = gpiochip_add_data(&sgpio->chip.gc, sgpio);
        if (err) {
-               dev_err(&pdev->dev, "%s: error in probe function with status %d\n",
-                       np->full_name, err);
+               dev_err(&pdev->dev, "%pOF: error in probe function with status %d\n",
+                       np, err);
                goto out;
        }