All of lore.kernel.org
 help / color / mirror / Atom feed
From: swarren@wwwdotorg.org (Stephen Warren)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/3] pinctrl: display pin name instead of raw pin id
Date: Mon, 16 Apr 2012 12:11:58 -0600	[thread overview]
Message-ID: <4F8C60EE.30008@wwwdotorg.org> (raw)
In-Reply-To: <1334585244-10249-1-git-send-email-b29396@freescale.com>

On 04/16/2012 08:07 AM, Dong Aisheng wrote:
> From: Dong Aisheng <dong.aisheng@linaro.org>
> 
> Pin name is more useful to users.

> diff --git a/drivers/pinctrl/core.c b/drivers/pinctrl/core.c

> @@ -964,10 +984,14 @@ static int pinctrl_groups_show(struct seq_file *s, void *what)
>  			seq_printf(s, "%s [ERROR GETTING PINS]\n",
>  				   gname);
>  		else {
> +			seq_printf(s, "group: %s\n", gname);
> +			for (i = 0; i < num_pins; i++) {
> +				pname = pin_get_name(pctldev, pins[i]);
> +				if (!pname)
> +					return -EINVAL;

I'd rather see this say pname = "(unknown)" instead of return, to get as
much of the information into debugfs possible even in the face of errors.

But perhaps that condition should even be a BUG(); it would imply that
pinctrl_register_on_pin() had failed pretty badly.

> diff --git a/drivers/pinctrl/pinmux.c b/drivers/pinctrl/pinmux.c
> index c494c37..fa0357b 100644
> --- a/drivers/pinctrl/pinmux.c
> +++ b/drivers/pinctrl/pinmux.c
> @@ -88,8 +88,6 @@ static int pin_request(struct pinctrl_dev *pctldev,
>  	const struct pinmux_ops *ops = pctldev->desc->pmxops;
>  	int status = -EINVAL;
>  
> -	dev_dbg(pctldev->dev, "request pin %d for %s\n", pin, owner);
> -
>  	desc = pin_desc_get(pctldev, pin);
>  	if (desc == NULL) {
>  		dev_err(pctldev->dev,
> @@ -97,6 +95,9 @@ static int pin_request(struct pinctrl_dev *pctldev,
>  		goto out;
>  	}
>  
> +	dev_dbg(pctldev->dev, "request pin %d (%s) for %s\n",
> +		pin, desc->name, owner);
> +
>  	if (gpio_range) {
>  		/* There's no need to support multiple GPIO requests */
>  		if (desc->gpio_owner) {

That seems like it should be a separate patch?

WARNING: multiple messages have this Message-ID (diff)
From: Stephen Warren <swarren@wwwdotorg.org>
To: Dong Aisheng <b29396@freescale.com>
Cc: linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linus.walleij@stericsson.com
Subject: Re: [PATCH 1/3] pinctrl: display pin name instead of raw pin id
Date: Mon, 16 Apr 2012 12:11:58 -0600	[thread overview]
Message-ID: <4F8C60EE.30008@wwwdotorg.org> (raw)
In-Reply-To: <1334585244-10249-1-git-send-email-b29396@freescale.com>

On 04/16/2012 08:07 AM, Dong Aisheng wrote:
> From: Dong Aisheng <dong.aisheng@linaro.org>
> 
> Pin name is more useful to users.

> diff --git a/drivers/pinctrl/core.c b/drivers/pinctrl/core.c

> @@ -964,10 +984,14 @@ static int pinctrl_groups_show(struct seq_file *s, void *what)
>  			seq_printf(s, "%s [ERROR GETTING PINS]\n",
>  				   gname);
>  		else {
> +			seq_printf(s, "group: %s\n", gname);
> +			for (i = 0; i < num_pins; i++) {
> +				pname = pin_get_name(pctldev, pins[i]);
> +				if (!pname)
> +					return -EINVAL;

I'd rather see this say pname = "(unknown)" instead of return, to get as
much of the information into debugfs possible even in the face of errors.

But perhaps that condition should even be a BUG(); it would imply that
pinctrl_register_on_pin() had failed pretty badly.

> diff --git a/drivers/pinctrl/pinmux.c b/drivers/pinctrl/pinmux.c
> index c494c37..fa0357b 100644
> --- a/drivers/pinctrl/pinmux.c
> +++ b/drivers/pinctrl/pinmux.c
> @@ -88,8 +88,6 @@ static int pin_request(struct pinctrl_dev *pctldev,
>  	const struct pinmux_ops *ops = pctldev->desc->pmxops;
>  	int status = -EINVAL;
>  
> -	dev_dbg(pctldev->dev, "request pin %d for %s\n", pin, owner);
> -
>  	desc = pin_desc_get(pctldev, pin);
>  	if (desc == NULL) {
>  		dev_err(pctldev->dev,
> @@ -97,6 +95,9 @@ static int pin_request(struct pinctrl_dev *pctldev,
>  		goto out;
>  	}
>  
> +	dev_dbg(pctldev->dev, "request pin %d (%s) for %s\n",
> +		pin, desc->name, owner);
> +
>  	if (gpio_range) {
>  		/* There's no need to support multiple GPIO requests */
>  		if (desc->gpio_owner) {

That seems like it should be a separate patch?

  parent reply	other threads:[~2012-04-16 18:11 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-16 14:07 [PATCH 1/3] pinctrl: display pin name instead of raw pin id Dong Aisheng
2012-04-16 14:07 ` Dong Aisheng
2012-04-16 14:07 ` [PATCH 2/3] pinctrl: a minor fix of pin config debug information Dong Aisheng
2012-04-16 14:07   ` Dong Aisheng
2012-04-18 11:15   ` Linus Walleij
2012-04-18 11:15     ` Linus Walleij
2012-04-16 18:11 ` Stephen Warren [this message]
2012-04-16 18:11   ` [PATCH 1/3] pinctrl: display pin name instead of raw pin id Stephen Warren
2012-04-17  6:34   ` Dong Aisheng
2012-04-17  6:34     ` Dong Aisheng

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4F8C60EE.30008@wwwdotorg.org \
    --to=swarren@wwwdotorg.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.