diff options
author | Rob Herring <robh@kernel.org> | 2017-07-18 17:43:23 -0400 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2017-08-14 09:01:02 -0400 |
commit | f5292d06c4f1d0c220d7c9e9c0553cabe5b37d4c (patch) | |
tree | 5370dfdfff75b63bdbd7be7a94ea62fe1e946542 | |
parent | 725e222141fe0999a667bec5803c89f4a99832b0 (diff) |
pinctrl: Convert to using %pOF instead of full_name
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>
-rw-r--r-- | drivers/pinctrl/bcm/pinctrl-bcm2835.c | 25 | ||||
-rw-r--r-- | drivers/pinctrl/devicetree.c | 4 | ||||
-rw-r--r-- | drivers/pinctrl/freescale/pinctrl-imx.c | 8 | ||||
-rw-r--r-- | drivers/pinctrl/pinconf-generic.c | 7 | ||||
-rw-r--r-- | drivers/pinctrl/pinctrl-at91-pio4.c | 11 | ||||
-rw-r--r-- | drivers/pinctrl/pinctrl-st.c | 2 | ||||
-rw-r--r-- | drivers/pinctrl/pinctrl-tb10x.c | 4 | ||||
-rw-r--r-- | drivers/pinctrl/samsung/pinctrl-samsung.c | 6 | ||||
-rw-r--r-- | drivers/pinctrl/sh-pfc/pinctrl.c | 2 | ||||
-rw-r--r-- | drivers/pinctrl/sirf/pinctrl-sirf.c | 6 |
10 files changed, 34 insertions, 41 deletions
diff --git a/drivers/pinctrl/bcm/pinctrl-bcm2835.c b/drivers/pinctrl/bcm/pinctrl-bcm2835.c index 7203f35a2680..7b7bd26f704a 100644 --- a/drivers/pinctrl/bcm/pinctrl-bcm2835.c +++ b/drivers/pinctrl/bcm/pinctrl-bcm2835.c | |||
@@ -692,8 +692,7 @@ static int bcm2835_pctl_dt_node_to_map_func(struct bcm2835_pinctrl *pc, | |||
692 | struct pinctrl_map *map = *maps; | 692 | struct pinctrl_map *map = *maps; |
693 | 693 | ||
694 | if (fnum >= ARRAY_SIZE(bcm2835_functions)) { | 694 | if (fnum >= ARRAY_SIZE(bcm2835_functions)) { |
695 | dev_err(pc->dev, "%s: invalid brcm,function %d\n", | 695 | dev_err(pc->dev, "%pOF: invalid brcm,function %d\n", np, fnum); |
696 | of_node_full_name(np), fnum); | ||
697 | return -EINVAL; | 696 | return -EINVAL; |
698 | } | 697 | } |
699 | 698 | ||
@@ -713,8 +712,7 @@ static int bcm2835_pctl_dt_node_to_map_pull(struct bcm2835_pinctrl *pc, | |||
713 | unsigned long *configs; | 712 | unsigned long *configs; |
714 | 713 | ||
715 | if (pull > 2) { | 714 | if (pull > 2) { |
716 | dev_err(pc->dev, "%s: invalid brcm,pull %d\n", | 715 | dev_err(pc->dev, "%pOF: invalid brcm,pull %d\n", np, pull); |
717 | of_node_full_name(np), pull); | ||
718 | return -EINVAL; | 716 | return -EINVAL; |
719 | } | 717 | } |
720 | 718 | ||
@@ -745,8 +743,7 @@ static int bcm2835_pctl_dt_node_to_map(struct pinctrl_dev *pctldev, | |||
745 | 743 | ||
746 | pins = of_find_property(np, "brcm,pins", NULL); | 744 | pins = of_find_property(np, "brcm,pins", NULL); |
747 | if (!pins) { | 745 | if (!pins) { |
748 | dev_err(pc->dev, "%s: missing brcm,pins property\n", | 746 | dev_err(pc->dev, "%pOF: missing brcm,pins property\n", np); |
749 | of_node_full_name(np)); | ||
750 | return -EINVAL; | 747 | return -EINVAL; |
751 | } | 748 | } |
752 | 749 | ||
@@ -755,8 +752,8 @@ static int bcm2835_pctl_dt_node_to_map(struct pinctrl_dev *pctldev, | |||
755 | 752 | ||
756 | if (!funcs && !pulls) { | 753 | if (!funcs && !pulls) { |
757 | dev_err(pc->dev, | 754 | dev_err(pc->dev, |
758 | "%s: neither brcm,function nor brcm,pull specified\n", | 755 | "%pOF: neither brcm,function nor brcm,pull specified\n", |
759 | of_node_full_name(np)); | 756 | np); |
760 | return -EINVAL; | 757 | return -EINVAL; |
761 | } | 758 | } |
762 | 759 | ||
@@ -766,15 +763,15 @@ static int bcm2835_pctl_dt_node_to_map(struct pinctrl_dev *pctldev, | |||
766 | 763 | ||
767 | if (num_funcs > 1 && num_funcs != num_pins) { | 764 | if (num_funcs > 1 && num_funcs != num_pins) { |
768 | dev_err(pc->dev, | 765 | dev_err(pc->dev, |
769 | "%s: brcm,function must have 1 or %d entries\n", | 766 | "%pOF: brcm,function must have 1 or %d entries\n", |
770 | of_node_full_name(np), num_pins); | 767 | np, num_pins); |
771 | return -EINVAL; | 768 | return -EINVAL; |
772 | } | 769 | } |
773 | 770 | ||
774 | if (num_pulls > 1 && num_pulls != num_pins) { | 771 | if (num_pulls > 1 && num_pulls != num_pins) { |
775 | dev_err(pc->dev, | 772 | dev_err(pc->dev, |
776 | "%s: brcm,pull must have 1 or %d entries\n", | 773 | "%pOF: brcm,pull must have 1 or %d entries\n", |
777 | of_node_full_name(np), num_pins); | 774 | np, num_pins); |
778 | return -EINVAL; | 775 | return -EINVAL; |
779 | } | 776 | } |
780 | 777 | ||
@@ -793,8 +790,8 @@ static int bcm2835_pctl_dt_node_to_map(struct pinctrl_dev *pctldev, | |||
793 | if (err) | 790 | if (err) |
794 | goto out; | 791 | goto out; |
795 | if (pin >= ARRAY_SIZE(bcm2835_gpio_pins)) { | 792 | if (pin >= ARRAY_SIZE(bcm2835_gpio_pins)) { |
796 | dev_err(pc->dev, "%s: invalid brcm,pins value %d\n", | 793 | dev_err(pc->dev, "%pOF: invalid brcm,pins value %d\n", |
797 | of_node_full_name(np), pin); | 794 | np, pin); |
798 | err = -EINVAL; | 795 | err = -EINVAL; |
799 | goto out; | 796 | goto out; |
800 | } | 797 | } |
diff --git a/drivers/pinctrl/devicetree.c b/drivers/pinctrl/devicetree.c index 0e5c9f14a706..0a20afc2210c 100644 --- a/drivers/pinctrl/devicetree.c +++ b/drivers/pinctrl/devicetree.c | |||
@@ -117,8 +117,8 @@ static int dt_to_map_one_config(struct pinctrl *p, | |||
117 | for (;;) { | 117 | for (;;) { |
118 | np_pctldev = of_get_next_parent(np_pctldev); | 118 | np_pctldev = of_get_next_parent(np_pctldev); |
119 | if (!np_pctldev || of_node_is_root(np_pctldev)) { | 119 | if (!np_pctldev || of_node_is_root(np_pctldev)) { |
120 | dev_info(p->dev, "could not find pctldev for node %s, deferring probe\n", | 120 | dev_info(p->dev, "could not find pctldev for node %pOF, deferring probe\n", |
121 | np_config->full_name); | 121 | np_config); |
122 | of_node_put(np_pctldev); | 122 | of_node_put(np_pctldev); |
123 | /* OK let's just assume this will appear later then */ | 123 | /* OK let's just assume this will appear later then */ |
124 | return -EPROBE_DEFER; | 124 | return -EPROBE_DEFER; |
diff --git a/drivers/pinctrl/freescale/pinctrl-imx.c b/drivers/pinctrl/freescale/pinctrl-imx.c index ad23e396da81..6e472691d8ee 100644 --- a/drivers/pinctrl/freescale/pinctrl-imx.c +++ b/drivers/pinctrl/freescale/pinctrl-imx.c | |||
@@ -461,16 +461,14 @@ static int imx_pinctrl_parse_groups(struct device_node *np, | |||
461 | list = of_get_property(np, "pinmux", &size); | 461 | list = of_get_property(np, "pinmux", &size); |
462 | if (!list) { | 462 | if (!list) { |
463 | dev_err(info->dev, | 463 | dev_err(info->dev, |
464 | "no fsl,pins and pins property in node %s\n", | 464 | "no fsl,pins and pins property in node %pOF\n", np); |
465 | np->full_name); | ||
466 | return -EINVAL; | 465 | return -EINVAL; |
467 | } | 466 | } |
468 | } | 467 | } |
469 | 468 | ||
470 | /* we do not check return since it's safe node passed down */ | 469 | /* we do not check return since it's safe node passed down */ |
471 | if (!size || size % pin_size) { | 470 | if (!size || size % pin_size) { |
472 | dev_err(info->dev, "Invalid fsl,pins or pins property in node %s\n", | 471 | dev_err(info->dev, "Invalid fsl,pins or pins property in node %pOF\n", np); |
473 | np->full_name); | ||
474 | return -EINVAL; | 472 | return -EINVAL; |
475 | } | 473 | } |
476 | 474 | ||
@@ -554,7 +552,7 @@ static int imx_pinctrl_parse_functions(struct device_node *np, | |||
554 | func->name = np->name; | 552 | func->name = np->name; |
555 | func->num_group_names = of_get_child_count(np); | 553 | func->num_group_names = of_get_child_count(np); |
556 | if (func->num_group_names == 0) { | 554 | if (func->num_group_names == 0) { |
557 | dev_err(info->dev, "no groups defined in %s\n", np->full_name); | 555 | dev_err(info->dev, "no groups defined in %pOF\n", np); |
558 | return -EINVAL; | 556 | return -EINVAL; |
559 | } | 557 | } |
560 | func->group_names = devm_kcalloc(info->dev, func->num_group_names, | 558 | func->group_names = devm_kcalloc(info->dev, func->num_group_names, |
diff --git a/drivers/pinctrl/pinconf-generic.c b/drivers/pinctrl/pinconf-generic.c index fc0c230aa11f..4cf901c78130 100644 --- a/drivers/pinctrl/pinconf-generic.c +++ b/drivers/pinctrl/pinconf-generic.c | |||
@@ -316,16 +316,15 @@ int pinconf_generic_dt_subnode_to_map(struct pinctrl_dev *pctldev, | |||
316 | if (ret < 0) { | 316 | if (ret < 0) { |
317 | /* EINVAL=missing, which is fine since it's optional */ | 317 | /* EINVAL=missing, which is fine since it's optional */ |
318 | if (ret != -EINVAL) | 318 | if (ret != -EINVAL) |
319 | dev_err(dev, "%s: could not parse property function\n", | 319 | dev_err(dev, "%pOF: could not parse property function\n", |
320 | of_node_full_name(np)); | 320 | np); |
321 | function = NULL; | 321 | function = NULL; |
322 | } | 322 | } |
323 | 323 | ||
324 | ret = pinconf_generic_parse_dt_config(np, pctldev, &configs, | 324 | ret = pinconf_generic_parse_dt_config(np, pctldev, &configs, |
325 | &num_configs); | 325 | &num_configs); |
326 | if (ret < 0) { | 326 | if (ret < 0) { |
327 | dev_err(dev, "%s: could not parse node property\n", | 327 | dev_err(dev, "%pOF: could not parse node property\n", np); |
328 | of_node_full_name(np)); | ||
329 | return ret; | 328 | return ret; |
330 | } | 329 | } |
331 | 330 | ||
diff --git a/drivers/pinctrl/pinctrl-at91-pio4.c b/drivers/pinctrl/pinctrl-at91-pio4.c index dc8591543dee..b1ca838dd80a 100644 --- a/drivers/pinctrl/pinctrl-at91-pio4.c +++ b/drivers/pinctrl/pinctrl-at91-pio4.c | |||
@@ -494,8 +494,8 @@ static int atmel_pctl_dt_subnode_to_map(struct pinctrl_dev *pctldev, | |||
494 | ret = pinconf_generic_parse_dt_config(np, pctldev, &configs, | 494 | ret = pinconf_generic_parse_dt_config(np, pctldev, &configs, |
495 | &num_configs); | 495 | &num_configs); |
496 | if (ret < 0) { | 496 | if (ret < 0) { |
497 | dev_err(pctldev->dev, "%s: could not parse node property\n", | 497 | dev_err(pctldev->dev, "%pOF: could not parse node property\n", |
498 | of_node_full_name(np)); | 498 | np); |
499 | return ret; | 499 | return ret; |
500 | } | 500 | } |
501 | 501 | ||
@@ -504,8 +504,7 @@ static int atmel_pctl_dt_subnode_to_map(struct pinctrl_dev *pctldev, | |||
504 | 504 | ||
505 | num_pins = pins->length / sizeof(u32); | 505 | num_pins = pins->length / sizeof(u32); |
506 | if (!num_pins) { | 506 | if (!num_pins) { |
507 | dev_err(pctldev->dev, "no pins found in node %s\n", | 507 | dev_err(pctldev->dev, "no pins found in node %pOF\n", np); |
508 | of_node_full_name(np)); | ||
509 | ret = -EINVAL; | 508 | ret = -EINVAL; |
510 | goto exit; | 509 | goto exit; |
511 | } | 510 | } |
@@ -584,8 +583,8 @@ static int atmel_pctl_dt_node_to_map(struct pinctrl_dev *pctldev, | |||
584 | 583 | ||
585 | if (ret < 0) { | 584 | if (ret < 0) { |
586 | pinctrl_utils_free_map(pctldev, *map, *num_maps); | 585 | pinctrl_utils_free_map(pctldev, *map, *num_maps); |
587 | dev_err(pctldev->dev, "can't create maps for node %s\n", | 586 | dev_err(pctldev->dev, "can't create maps for node %pOF\n", |
588 | np_config->full_name); | 587 | np_config); |
589 | } | 588 | } |
590 | 589 | ||
591 | return ret; | 590 | return ret; |
diff --git a/drivers/pinctrl/pinctrl-st.c b/drivers/pinctrl/pinctrl-st.c index 5d4789daf396..7ac8b1e033fe 100644 --- a/drivers/pinctrl/pinctrl-st.c +++ b/drivers/pinctrl/pinctrl-st.c | |||
@@ -1537,7 +1537,7 @@ static int st_gpiolib_register_bank(struct st_pinctrl *info, | |||
1537 | return err; | 1537 | return err; |
1538 | } | 1538 | } |
1539 | } else { | 1539 | } else { |
1540 | dev_info(dev, "No IRQ support for %s bank\n", np->full_name); | 1540 | dev_info(dev, "No IRQ support for %pOF bank\n", np); |
1541 | } | 1541 | } |
1542 | 1542 | ||
1543 | return 0; | 1543 | return 0; |
diff --git a/drivers/pinctrl/pinctrl-tb10x.c b/drivers/pinctrl/pinctrl-tb10x.c index edfba506e958..09d35006acb2 100644 --- a/drivers/pinctrl/pinctrl-tb10x.c +++ b/drivers/pinctrl/pinctrl-tb10x.c | |||
@@ -557,8 +557,8 @@ static int tb10x_dt_node_to_map(struct pinctrl_dev *pctl, | |||
557 | int ret = 0; | 557 | int ret = 0; |
558 | 558 | ||
559 | if (of_property_read_string(np_config, "abilis,function", &string)) { | 559 | if (of_property_read_string(np_config, "abilis,function", &string)) { |
560 | pr_err("%s: No abilis,function property in device tree.\n", | 560 | pr_err("%pOF: No abilis,function property in device tree.\n", |
561 | np_config->full_name); | 561 | np_config); |
562 | return -EINVAL; | 562 | return -EINVAL; |
563 | } | 563 | } |
564 | 564 | ||
diff --git a/drivers/pinctrl/samsung/pinctrl-samsung.c b/drivers/pinctrl/samsung/pinctrl-samsung.c index f542642eed8d..20b59bb02196 100644 --- a/drivers/pinctrl/samsung/pinctrl-samsung.c +++ b/drivers/pinctrl/samsung/pinctrl-samsung.c | |||
@@ -679,7 +679,7 @@ static int samsung_pinctrl_create_function(struct device *dev, | |||
679 | 679 | ||
680 | npins = of_property_count_strings(func_np, "samsung,pins"); | 680 | npins = of_property_count_strings(func_np, "samsung,pins"); |
681 | if (npins < 1) { | 681 | if (npins < 1) { |
682 | dev_err(dev, "invalid pin list in %s node", func_np->name); | 682 | dev_err(dev, "invalid pin list in %pOFn node", func_np); |
683 | return -EINVAL; | 683 | return -EINVAL; |
684 | } | 684 | } |
685 | 685 | ||
@@ -696,8 +696,8 @@ static int samsung_pinctrl_create_function(struct device *dev, | |||
696 | i, &gname); | 696 | i, &gname); |
697 | if (ret) { | 697 | if (ret) { |
698 | dev_err(dev, | 698 | dev_err(dev, |
699 | "failed to read pin name %d from %s node\n", | 699 | "failed to read pin name %d from %pOFn node\n", |
700 | i, func_np->name); | 700 | i, func_np); |
701 | return ret; | 701 | return ret; |
702 | } | 702 | } |
703 | 703 | ||
diff --git a/drivers/pinctrl/sh-pfc/pinctrl.c b/drivers/pinctrl/sh-pfc/pinctrl.c index a70157f0acf4..e7a92eec06c2 100644 --- a/drivers/pinctrl/sh-pfc/pinctrl.c +++ b/drivers/pinctrl/sh-pfc/pinctrl.c | |||
@@ -290,7 +290,7 @@ static int sh_pfc_dt_node_to_map(struct pinctrl_dev *pctldev, | |||
290 | if (*num_maps) | 290 | if (*num_maps) |
291 | return 0; | 291 | return 0; |
292 | 292 | ||
293 | dev_err(dev, "no mapping found in node %s\n", np->full_name); | 293 | dev_err(dev, "no mapping found in node %pOF\n", np); |
294 | ret = -EINVAL; | 294 | ret = -EINVAL; |
295 | 295 | ||
296 | done: | 296 | done: |
diff --git a/drivers/pinctrl/sirf/pinctrl-sirf.c b/drivers/pinctrl/sirf/pinctrl-sirf.c index 0df72be60704..80bfd4719199 100644 --- a/drivers/pinctrl/sirf/pinctrl-sirf.c +++ b/drivers/pinctrl/sirf/pinctrl-sirf.c | |||
@@ -810,7 +810,7 @@ static int sirfsoc_gpio_probe(struct device_node *np) | |||
810 | sgpio->chip.gc.set = sirfsoc_gpio_set_value; | 810 | sgpio->chip.gc.set = sirfsoc_gpio_set_value; |
811 | sgpio->chip.gc.base = 0; | 811 | sgpio->chip.gc.base = 0; |
812 | sgpio->chip.gc.ngpio = SIRFSOC_GPIO_BANK_SIZE * SIRFSOC_GPIO_NO_OF_BANKS; | 812 | sgpio->chip.gc.ngpio = SIRFSOC_GPIO_BANK_SIZE * SIRFSOC_GPIO_NO_OF_BANKS; |
813 | sgpio->chip.gc.label = kstrdup(np->full_name, GFP_KERNEL); | 813 | sgpio->chip.gc.label = kasprintf(GFP_KERNEL, "%pOF", np); |
814 | sgpio->chip.gc.of_node = np; | 814 | sgpio->chip.gc.of_node = np; |
815 | sgpio->chip.gc.of_xlate = sirfsoc_gpio_of_xlate; | 815 | sgpio->chip.gc.of_xlate = sirfsoc_gpio_of_xlate; |
816 | sgpio->chip.gc.of_gpio_n_cells = 2; | 816 | sgpio->chip.gc.of_gpio_n_cells = 2; |
@@ -819,8 +819,8 @@ static int sirfsoc_gpio_probe(struct device_node *np) | |||
819 | 819 | ||
820 | err = gpiochip_add_data(&sgpio->chip.gc, sgpio); | 820 | err = gpiochip_add_data(&sgpio->chip.gc, sgpio); |
821 | if (err) { | 821 | if (err) { |
822 | dev_err(&pdev->dev, "%s: error in probe function with status %d\n", | 822 | dev_err(&pdev->dev, "%pOF: error in probe function with status %d\n", |
823 | np->full_name, err); | 823 | np, err); |
824 | goto out; | 824 | goto out; |
825 | } | 825 | } |
826 | 826 | ||