2014-07-04 10:03:05

by Tushar Behera

[permalink] [raw]
Subject: [PATCH] gpiolib: of: Update debug messages for of_get_named_gpiod_flags

Following is the debug output (only a few examples) before and after the patch.

$ dmesg | grep of_get_named_gpiod_flags

Before:
of_get_named_gpiod_flags: can't parse gpios property of node '/mmc@12220000[0]'
of_get_named_gpiod_flags exited with status 0

After:
of_get_named_gpiod_flags: can't parse 'wp-gpios' property of node '/mmc@12220000[0]'
of_get_named_gpiod_flags: parsed 'gpios' property of node '/gpio-keys/power[0]' - status (0)

Signed-off-by: Tushar Behera <[email protected]>
---
drivers/gpio/gpiolib-of.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/gpio/gpiolib-of.c b/drivers/gpio/gpiolib-of.c
index af7e25c..e60cdab 100644
--- a/drivers/gpio/gpiolib-of.c
+++ b/drivers/gpio/gpiolib-of.c
@@ -82,15 +82,16 @@ struct gpio_desc *of_get_named_gpiod_flags(struct device_node *np,
ret = of_parse_phandle_with_args(np, propname, "#gpio-cells", index,
&gg_data.gpiospec);
if (ret) {
- pr_debug("%s: can't parse gpios property of node '%s[%d]'\n",
- __func__, np->full_name, index);
+ pr_debug("%s: can't parse '%s' property of node '%s[%d]'\n",
+ __func__, propname, np->full_name, index);
return ERR_PTR(ret);
}

gpiochip_find(&gg_data, of_gpiochip_find_and_xlate);

of_node_put(gg_data.gpiospec.np);
- pr_debug("%s exited with status %d\n", __func__,
+ pr_debug("%s: parsed '%s' property of node '%s[%d]' - status (%d)\n",
+ __func__, propname, np->full_name, index,
PTR_ERR_OR_ZERO(gg_data.out_gpio));
return gg_data.out_gpio;
}
--
1.7.9.5


2014-07-06 09:33:23

by Alexandre Courbot

[permalink] [raw]
Subject: Re: [PATCH] gpiolib: of: Update debug messages for of_get_named_gpiod_flags

On Fri, Jul 4, 2014 at 6:52 PM, Tushar Behera <[email protected]> wrote:
> Following is the debug output (only a few examples) before and after the patch.
>
> $ dmesg | grep of_get_named_gpiod_flags
>
> Before:
> of_get_named_gpiod_flags: can't parse gpios property of node '/mmc@12220000[0]'
> of_get_named_gpiod_flags exited with status 0
>
> After:
> of_get_named_gpiod_flags: can't parse 'wp-gpios' property of node '/mmc@12220000[0]'
> of_get_named_gpiod_flags: parsed 'gpios' property of node '/gpio-keys/power[0]' - status (0)
>
> Signed-off-by: Tushar Behera <[email protected]>

More meaningful debug messages are always a good thing.

Reviewed-by: Alexandre Courbot <[email protected]>

2014-07-09 07:48:58

by Linus Walleij

[permalink] [raw]
Subject: Re: [PATCH] gpiolib: of: Update debug messages for of_get_named_gpiod_flags

On Fri, Jul 4, 2014 at 11:52 AM, Tushar Behera <[email protected]> wrote:

> Following is the debug output (only a few examples) before and after the patch.
>
> $ dmesg | grep of_get_named_gpiod_flags
>
> Before:
> of_get_named_gpiod_flags: can't parse gpios property of node '/mmc@12220000[0]'
> of_get_named_gpiod_flags exited with status 0
>
> After:
> of_get_named_gpiod_flags: can't parse 'wp-gpios' property of node '/mmc@12220000[0]'
> of_get_named_gpiod_flags: parsed 'gpios' property of node '/gpio-keys/power[0]' - status (0)
>
> Signed-off-by: Tushar Behera <[email protected]>

Patch applied with Alexandre's ACK.

Yours,
Linus Walleij