From: Andrew Lunn <andrew@lunn.ch>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: linux-gpio@vger.kernel.org,
Bartosz Golaszewski <bgolaszewski@baylibre.com>,
Patrice Chotard <patrice.chotard@st.com>,
Andrew Jeffery <andrew@aj.id.au>, Joel Stanley <joel@jms.id.au>,
Thierry Reding <treding@nvidia.com>,
Hans de Goede <hdegoede@redhat.com>,
Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
Mika Westerberg <mika.westerberg@linux.intel.com>
Subject: Re: [PATCH] gpio: Initialize the irqchip valid_mask with a callback
Date: Thu, 5 Sep 2019 08:34:10 +0200 [thread overview]
Message-ID: <20190905063410.GA415@lunn.ch> (raw)
In-Reply-To: <20190904140104.32426-1-linus.walleij@linaro.org>
On Wed, Sep 04, 2019 at 04:01:04PM +0200, Linus Walleij wrote:
> diff --git a/drivers/gpio/gpio-tqmx86.c b/drivers/gpio/gpio-tqmx86.c
> index 07050cdbadb9..a3109bcaa0ac 100644
> --- a/drivers/gpio/gpio-tqmx86.c
> +++ b/drivers/gpio/gpio-tqmx86.c
> @@ -214,6 +214,17 @@ static const struct dev_pm_ops tqmx86_gpio_dev_pm_ops = {
> tqmx86_gpio_runtime_resume, NULL)
> };
>
> +static void tqmx86_init_irq_valid_mask(struct gpio_chip *chip,
> + unsigned long *valid_mask,
> + unsigned int ngpios)
> +{
> + /* Only GPIOs 4-7 are valid for interrupts. Clear the others */
> + clear_bit(0, valid_mask);
> + clear_bit(1, valid_mask);
> + clear_bit(2, valid_mask);
> + clear_bit(3, valid_mask);
> +}
Hi Linus
The change looks good. But a minor naming nit-pick. The code here
assumes valid_mask has already been initialised, all valid gpios have
had their bit set to 1 by the core. What we are actually doing here is
masking the mask to fit the hardware.
So maybe a better name would be tqmx86_mask_irq_valid_mask()?
For gpio-tqmx86.c
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Andrew
next prev parent reply other threads:[~2019-09-05 6:34 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-04 14:01 [PATCH] gpio: Initialize the irqchip valid_mask with a callback Linus Walleij
2019-09-04 15:15 ` Andy Shevchenko
2019-09-04 22:13 ` Hans de Goede
2019-09-05 1:48 ` Andrew Jeffery
2019-09-05 5:01 ` Mika Westerberg
2019-09-05 6:34 ` Andrew Lunn [this message]
2019-09-06 9:57 ` Patrice CHOTARD
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=20190905063410.GA415@lunn.ch \
--to=andrew@lunn.ch \
--cc=andrew@aj.id.au \
--cc=andriy.shevchenko@linux.intel.com \
--cc=bgolaszewski@baylibre.com \
--cc=hdegoede@redhat.com \
--cc=joel@jms.id.au \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=mika.westerberg@linux.intel.com \
--cc=patrice.chotard@st.com \
--cc=treding@nvidia.com \
/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).