gpio: Convert to using %pOF instead of full_name
Subsystems (6)
PATCH 1/1 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 <[email protected]>
Cc Tien Hock Loh <[email protected]>
Cc Linus Walleij <[email protected]>
Cc Alexandre Courbot <[email protected]>
Cc Gregory Fong <[email protected]>
Cc Brian Norris <[email protected]>
Cc Florian Fainelli <[email protected]>
Cc bcm-kernel-feedback-list at broadcom.com
Cc Michal Simek <[email protected]>
Cc "S?ren Brinkmann" <[email protected]>
Cc linux-gpio at vger.kernel.org
Cc linux-arm-kernel at lists.infradead.org
--- drivers/gpio/gpio-altera.c | 4 ++-- drivers/gpio/gpio-brcmstb.c | 2 +- drivers/gpio/gpio-ge.c | 6 ++---- drivers/gpio/gpio-grgpio.c | 2 +- drivers/gpio/gpio-mpc8xxx.c | 4 ++-- drivers/gpio/gpio-tb10x.c | 3 ++- drivers/gpio/gpio-tz1090.c | 10 ++++------ drivers/gpio/gpio-xilinx.c | 4 ++-- drivers/gpio/gpiolib-of.c | 29 ++++++++++++++--------------- drivers/gpio/gpiolib.c | 2 +- 10 files changed, 31 insertions(+), 35 deletions(-)
drivers/gpio/gpio-altera.c +2 -2
@@ -324,8 +324,8 @@ static int altera_gpio_probe(struct platform_device *pdev)return 0 ; teardown:of_mm_gpiochip_remove (&altera_gc->mmchip); -pr_err ("%s: registration failed with status %d\n" , - node->full_name, ret); +pr_err ("%pOF: registration failed with status %d\n" , + node, ret);return ret; }
drivers/gpio/gpio-brcmstb.c +1 -1
@@ -483,7 +483,7 @@ static int brcmstb_gpio_probe(struct platform_device *pdev) gc->of_node = np; gc->owner =THIS_MODULE ; - gc->label = np->full_name; + gc->label =devm_kasprintf (dev,GFP_KERNEL ,"%pOF" , dev->of_node); gc->base = gpio_base; gc->of_gpio_n_cells =2 ; gc->of_xlate = brcmstb_gpio_of_xlate;
drivers/gpio/gpio-ge.c +2 -4
@@ -76,8 +76,7 @@ static int __init gef_gpio_probe(struct platform_device *pdev) }/* Setup pointers to chip functions */ - gc->label =devm_kstrdup (&pdev->dev, pdev->dev.of_node->full_name, -GFP_KERNEL ); + gc->label =devm_kasprintf (&pdev->dev,GFP_KERNEL ,"%pOF" , pdev->dev.of_node);if (!gc->label) { ret = -ENOMEM ; goto err0;
@@ -96,8 +95,7 @@ static int __init gef_gpio_probe(struct platform_device *pdev)return 0 ; err0:iounmap (regs); -pr_err ("%s: GPIO chip registration failed\n" , - pdev->dev.of_node->full_name); +pr_err ("%pOF: GPIO chip registration failed\n" , pdev->dev.of_node);return ret; };
drivers/gpio/gpio-grgpio.c +1 -1
@@ -367,7 +367,7 @@ static int grgpio_probe(struct platform_device *ofdev) gc->of_node = np; gc->owner =THIS_MODULE ; gc->to_irq = grgpio_to_irq; - gc->label = np->full_name; + gc->label =devm_kasprintf (&ofdev->dev,GFP_KERNEL ,"%pOF" , np); gc->base =-1 ; err =of_property_read_u32 (np,"nbits" , &prop);
drivers/gpio/gpio-mpc8xxx.c +2 -2
@@ -348,8 +348,8 @@ static int mpc8xxx_probe(struct platform_device *pdev) ret =gpiochip_add_data (gc, mpc8xxx_gc);if (ret) { -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); goto err; }
drivers/gpio/gpio-tb10x.c +2 -1
@@ -191,7 +191,8 @@ static int tb10x_gpio_probe(struct platform_device *pdev)if (IS_ERR (tb10x_gpio->base))return PTR_ERR (tb10x_gpio->base); - tb10x_gpio->gc.label =of_node_full_name (dn); + tb10x_gpio->gc.label = +devm_kasprintf (&pdev->dev,GFP_KERNEL ,"%pOF" , pdev->dev.of_node); tb10x_gpio->gc.parent = &pdev->dev; tb10x_gpio->gc.owner =THIS_MODULE ; tb10x_gpio->gc.direction_input = tb10x_gpio_direction_in;
drivers/gpio/gpio-tz1090.c +4 -6
@@ -527,13 +527,12 @@ static void tz1090_gpio_register_banks(struct tz1090_gpio *priv) ret =of_property_read_u32 (node,"reg" , &addr);if (ret) { -dev_err (priv->dev,"invalid reg on %s\n" , - node->full_name); +dev_err (priv->dev,"invalid reg on %pOF\n" , node);continue ; }if (addr >=3 ) { -dev_err (priv->dev,"index %u in %s out of range\n" , - addr, node->full_name); +dev_err (priv->dev,"index %u in %pOF out of range\n" , + addr, node);continue ; }
@@ -543,8 +542,7 @@ static void tz1090_gpio_register_banks(struct tz1090_gpio *priv) ret =tz1090_gpio_bank_probe (&info);if (ret) { -dev_err (priv->dev,"failure registering %s\n" , - node->full_name); +dev_err (priv->dev,"failure registering %pOF\n" , node);of_node_put (node);continue ; }
drivers/gpio/gpio-xilinx.c +2 -2
@@ -360,8 +360,8 @@ static int xgpio_probe(struct platform_device *pdev)/* Call the OF gpio helper to setup and register the GPIO device */ status =of_mm_gpiochip_add_data (np, &chip->mmchip, chip);if (status) { -pr_err ("%s: error in probe function with status %d\n" , - np->full_name, status); +pr_err ("%pOF: error in probe function with status %d\n" , + np, status);return status; }
drivers/gpio/gpiolib-of.c +14 -15
@@ -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 @@ int of_mm_gpiochip_add_data(struct device_node *np, 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 ; }
drivers/gpio/gpiolib.c +1 -1
@@ -1775,7 +1775,7 @@ int gpiochip_irqchip_add_key(struct gpio_chip *gpiochip,* conflicting triggers. Tell the user, and reset to NONE. */ if (WARN (of_node && type !=IRQ_TYPE_NONE , -"%s: Ignoring %d default trigger\n" , of_node->full_name, type)) +"%pOF: Ignoring %d default trigger\n" , of_node, type)) type =IRQ_TYPE_NONE ;if (has_acpi_companion (gpiochip->parent) && type !=IRQ_TYPE_NONE ) { acpi_handle_warn(ACPI_HANDLE(gpiochip->parent),
--
2.11.0
Quoted 5 lines · Rob Herring
Now that we have a custom printf format specifier, convert users of
full_nameto use %pOF instead. This is preparation to remove storing of the full path string for each node.Signed-off-by Rob Herring <[email protected]>
For the brcmstb part,
Acked-by Gregory Fong <[email protected]>
Quoted 4 lines · Rob Herring
Now that we have a custom printf format specifier, convert users of
full_nameto use %pOF instead. This is preparation to remove storing of the full path string for each node.
Quoted 12 lines
Signed-off-by Rob Herring <[email protected]>Cc Tien Hock Loh <[email protected]>Cc Linus Walleij <[email protected]>Cc Alexandre Courbot <[email protected]>Cc Gregory Fong <[email protected]>Cc Brian Norris <[email protected]>Cc Florian Fainelli <[email protected]>Cc bcm-kernel-feedback-list at broadcom.comCc Michal Simek <[email protected]>Cc "S?ren Brinkmann" <[email protected]>Cc linux-gpio at vger.kernel.orgCc linux-arm-kernel at lists.infradead.org
Patch applied.
Yours,
Linus Walleij