gpio: 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: Tien Hock Loh <thloh@altera.com> Cc: Linus Walleij <linus.walleij@linaro.org> Cc: Alexandre Courbot <gnurou@gmail.com> Cc: Brian Norris <computersforpeace@gmail.com> Cc: Florian Fainelli <f.fainelli@gmail.com> Cc: bcm-kernel-feedback-list@broadcom.com Cc: Michal Simek <michal.simek@xilinx.com> Cc: "Sören Brinkmann" <soren.brinkmann@xilinx.com> Cc: linux-gpio@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org Acked-by: Gregory Fong <gregory.0xf0@gmail.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
This commit is contained in:

committed by
Linus Walleij

parent
1a9ef909ac
commit
7eb6ce2f27
@@ -78,8 +78,8 @@ struct gpio_desc *of_get_named_gpiod_flags(struct device_node *np,
|
||||
ret = of_parse_phandle_with_args(np, propname, "#gpio-cells", index,
|
||||
&gpiospec);
|
||||
if (ret) {
|
||||
pr_debug("%s: can't parse '%s' property of node '%s[%d]'\n",
|
||||
__func__, propname, np->full_name, index);
|
||||
pr_debug("%s: can't parse '%s' property of node '%pOF[%d]'\n",
|
||||
__func__, propname, np, index);
|
||||
return ERR_PTR(ret);
|
||||
}
|
||||
|
||||
@@ -93,8 +93,8 @@ struct gpio_desc *of_get_named_gpiod_flags(struct device_node *np,
|
||||
if (IS_ERR(desc))
|
||||
goto out;
|
||||
|
||||
pr_debug("%s: parsed '%s' property of node '%s[%d]' - status (%d)\n",
|
||||
__func__, propname, np->full_name, index,
|
||||
pr_debug("%s: parsed '%s' property of node '%pOF[%d]' - status (%d)\n",
|
||||
__func__, propname, np, index,
|
||||
PTR_ERR_OR_ZERO(desc));
|
||||
|
||||
out:
|
||||
@@ -337,7 +337,7 @@ int of_mm_gpiochip_add_data(struct device_node *np,
|
||||
int ret = -ENOMEM;
|
||||
struct gpio_chip *gc = &mm_gc->gc;
|
||||
|
||||
gc->label = kstrdup(np->full_name, GFP_KERNEL);
|
||||
gc->label = kasprintf(GFP_KERNEL, "%pOF", np);
|
||||
if (!gc->label)
|
||||
goto err0;
|
||||
|
||||
@@ -362,8 +362,7 @@ err2:
|
||||
err1:
|
||||
kfree(gc->label);
|
||||
err0:
|
||||
pr_err("%s: GPIO chip registration failed with status %d\n",
|
||||
np->full_name, ret);
|
||||
pr_err("%pOF: GPIO chip registration failed with status %d\n", np, ret);
|
||||
return ret;
|
||||
}
|
||||
EXPORT_SYMBOL(of_mm_gpiochip_add_data);
|
||||
@@ -418,8 +417,8 @@ static int of_gpiochip_add_pin_range(struct gpio_chip *chip)
|
||||
group_names_propname,
|
||||
index, &name);
|
||||
if (strlen(name)) {
|
||||
pr_err("%s: Group name of numeric GPIO ranges must be the empty string.\n",
|
||||
np->full_name);
|
||||
pr_err("%pOF: Group name of numeric GPIO ranges must be the empty string.\n",
|
||||
np);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -434,14 +433,14 @@ static int of_gpiochip_add_pin_range(struct gpio_chip *chip)
|
||||
} else {
|
||||
/* npins == 0: special range */
|
||||
if (pinspec.args[1]) {
|
||||
pr_err("%s: Illegal gpio-range format.\n",
|
||||
np->full_name);
|
||||
pr_err("%pOF: Illegal gpio-range format.\n",
|
||||
np);
|
||||
break;
|
||||
}
|
||||
|
||||
if (!group_names) {
|
||||
pr_err("%s: GPIO group range requested but no %s property.\n",
|
||||
np->full_name, group_names_propname);
|
||||
pr_err("%pOF: GPIO group range requested but no %s property.\n",
|
||||
np, group_names_propname);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -452,8 +451,8 @@ static int of_gpiochip_add_pin_range(struct gpio_chip *chip)
|
||||
break;
|
||||
|
||||
if (!strlen(name)) {
|
||||
pr_err("%s: Group name of GPIO group range cannot be the empty string.\n",
|
||||
np->full_name);
|
||||
pr_err("%pOF: Group name of GPIO group range cannot be the empty string.\n",
|
||||
np);
|
||||
break;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user