From: swarren@wwwdotorg.org (Stephen Warren)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] pinctrl: improve warning messages
Date: Wed, 14 Aug 2013 10:34:38 -0600 [thread overview]
Message-ID: <520BB19E.8040901@wwwdotorg.org> (raw)
In-Reply-To: <1376497533-32303-1-git-send-email-linus.walleij@linaro.org>
On 08/14/2013 10:25 AM, Linus Walleij wrote:
> Print out the affected group name on activation of pin mux
> settings, and warn if you cannot free a pin that should have
> been part of a certain setting.
> diff --git a/drivers/pinctrl/pinmux.c b/drivers/pinctrl/pinmux.c
> @@ -411,9 +415,14 @@ int pinmux_enable_setting(struct pinctrl_setting const *setting)
> for (i = 0; i < num_pins; i++) {
> ret = pin_request(pctldev, pins[i], setting->dev_name, NULL);
> if (ret) {
> + const char *gname;
> +
> + gname = pctlops->get_group_name(pctldev,
> + setting->data.mux.group);
> dev_err(pctldev->dev,
> - "could not request pin %d on device %s\n",
> - pins[i], pinctrl_dev_get_name(pctldev));
> + "could not request pin %d from group %s on "
> + "device %s\n",
> + pins[i], gname, pinctrl_dev_get_name(pctldev));
I think it'd be useful to print the pin name rather than pin number here.
> @@ -486,6 +499,16 @@ void pinmux_disable_setting(struct pinctrl_setting const *setting)
> desc->mux_setting = NULL;
> /* And release the pin */
> pin_free(pctldev, pins[i], NULL);
> + } else {
> + const char *gname;
> +
> + gname = pctlops->get_group_name(pctldev,
> + setting->data.mux.group);
> + dev_warn(pctldev->dev,
> + "not freeing pin %d as part of deactivating "
> + "group %s - it is already used for some other "
> + "setting",
> + pins[i], gname);
> }
> }
I think that will only happen if one of the pinmux_enabling_setting
prints already happened. Is it worth adding this one?
WARNING: multiple messages have this Message-ID (diff)
From: Stephen Warren <swarren@wwwdotorg.org>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
Stephen Warren <swarren@nvidia.com>,
Sonic Zhang <sonic.zhang@analog.com>
Subject: Re: [PATCH] pinctrl: improve warning messages
Date: Wed, 14 Aug 2013 10:34:38 -0600 [thread overview]
Message-ID: <520BB19E.8040901@wwwdotorg.org> (raw)
In-Reply-To: <1376497533-32303-1-git-send-email-linus.walleij@linaro.org>
On 08/14/2013 10:25 AM, Linus Walleij wrote:
> Print out the affected group name on activation of pin mux
> settings, and warn if you cannot free a pin that should have
> been part of a certain setting.
> diff --git a/drivers/pinctrl/pinmux.c b/drivers/pinctrl/pinmux.c
> @@ -411,9 +415,14 @@ int pinmux_enable_setting(struct pinctrl_setting const *setting)
> for (i = 0; i < num_pins; i++) {
> ret = pin_request(pctldev, pins[i], setting->dev_name, NULL);
> if (ret) {
> + const char *gname;
> +
> + gname = pctlops->get_group_name(pctldev,
> + setting->data.mux.group);
> dev_err(pctldev->dev,
> - "could not request pin %d on device %s\n",
> - pins[i], pinctrl_dev_get_name(pctldev));
> + "could not request pin %d from group %s on "
> + "device %s\n",
> + pins[i], gname, pinctrl_dev_get_name(pctldev));
I think it'd be useful to print the pin name rather than pin number here.
> @@ -486,6 +499,16 @@ void pinmux_disable_setting(struct pinctrl_setting const *setting)
> desc->mux_setting = NULL;
> /* And release the pin */
> pin_free(pctldev, pins[i], NULL);
> + } else {
> + const char *gname;
> +
> + gname = pctlops->get_group_name(pctldev,
> + setting->data.mux.group);
> + dev_warn(pctldev->dev,
> + "not freeing pin %d as part of deactivating "
> + "group %s - it is already used for some other "
> + "setting",
> + pins[i], gname);
> }
> }
I think that will only happen if one of the pinmux_enabling_setting
prints already happened. Is it worth adding this one?
next prev parent reply other threads:[~2013-08-14 16:34 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-14 16:25 [PATCH] pinctrl: improve warning messages Linus Walleij
2013-08-14 16:25 ` Linus Walleij
2013-08-14 16:34 ` Stephen Warren [this message]
2013-08-14 16:34 ` Stephen Warren
2013-08-14 19:05 ` Linus Walleij
2013-08-14 19:05 ` Linus Walleij
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=520BB19E.8040901@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.