From: Bartosz Golaszewski <bgolaszewski@baylibre.com>
To: Lucas Stach <l.stach@pengutronix.de>
Cc: Linus Walleij <linus.walleij@linaro.org>,
linux-gpio <linux-gpio@vger.kernel.org>,
patchwork-lst@pengutronix.de, kernel@pengutronix.de
Subject: Re: [PATCH] gpio: of: don't warn if ignored GPIO flag matches the behavior
Date: Fri, 18 Oct 2019 14:28:31 +0200 [thread overview]
Message-ID: <CAMpxmJXwW-ZWwv2i8bbhDkdeya7-dqpqm7knAOFem4cYFsKX0Q@mail.gmail.com> (raw)
In-Reply-To: <20191018100538.9137-1-l.stach@pengutronix.de>
pt., 18 paź 2019 o 12:05 Lucas Stach <l.stach@pengutronix.de> napisał(a):
>
> Some devicetrees specify the ACTIVE_LOW flag in the fixed regulator GPIO
> handle. While this has always been ignored, it's consistent with the
> behavior of the regulator binding in the absence of the
> "enable-active-high" DT property. It doesn't make much sense to print a
> user visible warning for a configuration which is consistent, so only
> print the warning if the GPIO flag contradicts the behavior dictated by
> by the enable-active-high property.
>
> Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
> ---
> drivers/gpio/gpiolib-of.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpio/gpiolib-of.c b/drivers/gpio/gpiolib-of.c
> index 1eea2c6c2e1d..0b5383706b91 100644
> --- a/drivers/gpio/gpiolib-of.c
> +++ b/drivers/gpio/gpiolib-of.c
> @@ -134,18 +134,20 @@ static void of_gpio_flags_quirks(struct device_node *np,
> (!(strcmp(propname, "enable-gpio") &&
> strcmp(propname, "enable-gpios")) &&
> of_device_is_compatible(np, "regulator-gpio")))) {
> + bool active_low =
> + !of_property_read_bool(np, "enable-active-high");
> /*
> * The regulator GPIO handles are specified such that the
> * presence or absence of "enable-active-high" solely controls
> * the polarity of the GPIO line. Any phandle flags must
> * be actively ignored.
> */
> - if (*flags & OF_GPIO_ACTIVE_LOW) {
> + if ((*flags & OF_GPIO_ACTIVE_LOW) && !active_low) {
> pr_warn("%s GPIO handle specifies active low - ignored\n",
> of_node_full_name(np));
> *flags &= ~OF_GPIO_ACTIVE_LOW;
> }
> - if (!of_property_read_bool(np, "enable-active-high"))
> + if (active_low)
> *flags |= OF_GPIO_ACTIVE_LOW;
> }
> /*
> --
> 2.20.1
>
This makes perfect sense, so applied right away.
Bart
prev parent reply other threads:[~2019-10-18 12:28 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-18 10:05 [PATCH] gpio: of: don't warn if ignored GPIO flag matches the behavior Lucas Stach
2019-10-18 12:28 ` Bartosz Golaszewski [this message]
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=CAMpxmJXwW-ZWwv2i8bbhDkdeya7-dqpqm7knAOFem4cYFsKX0Q@mail.gmail.com \
--to=bgolaszewski@baylibre.com \
--cc=kernel@pengutronix.de \
--cc=l.stach@pengutronix.de \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=patchwork-lst@pengutronix.de \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).