From: Hans de Goede <hdegoede@redhat.com>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Mika Westerberg <mika.westerberg@linux.intel.com>,
Bartosz Golaszewski <bgolaszewski@baylibre.com>,
Linus Walleij <linus.walleij@linaro.org>,
linux-gpio@vger.kernel.org, linux-acpi@vger.kernel.org
Subject: Re: [PATCH v2 3/3] pinctrl: cherryview: Pass irqchip when adding gpiochip
Date: Wed, 13 Nov 2019 19:52:59 +0100 [thread overview]
Message-ID: <46a5e93d-b6d9-8c8d-647b-5a74840cea3d@redhat.com> (raw)
In-Reply-To: <20191106161753.GN32742@smile.fi.intel.com>
Hi,
On 06-11-2019 17:17, Andy Shevchenko wrote:
> On Wed, Nov 06, 2019 at 06:16:22PM +0200, Andy Shevchenko wrote:
>> On Wed, Nov 06, 2019 at 04:47:15PM +0100, Hans de Goede wrote:
>>> We need to convert all old gpio irqchips to pass the irqchip
>>> setup along when adding the gpio_chip. For more info see
>>> drivers/gpio/TODO.
>>>
>>> For chained irqchips this is a pretty straight-forward conversion.
>>
>>> + chip->irq.chip = &pctrl->irqchip;
>>
>>> + if (pctrl->need_valid_mask)
>>> + chip->irq.init_valid_mask = chv_init_irq_valid_mask;
>>
>> I just realize we probably may assign here unconditionally
>
> Continuing...
>
>>
>>> + chip->irq.init_hw = chv_gpio_irq_init_hw;
>>> + chip->irq.parent_handler = chv_gpio_irq_handler;
>>> + chip->irq.num_parents = 1;
>>> + chip->irq.parents = &pctrl->irq;
>>> + chip->irq.default_type = IRQ_TYPE_NONE;
>>> + chip->irq.handler = handle_bad_irq;
>>>
>>> if (!pctrl->need_valid_mask) {
>
> And here turn it back to NULL and check the pointer against NULL instead of
> additional variable.
>
> What do you think?
I think that first setting it and then clearing it again is not
very pretty. But ...
I do think you are on to something, we can use pctrl->chip.irq.init_valid_mask
instead of storing the dmi quirk in the chv_pinctrl struct.
Then we can leave the dmi handling as is, and replace later checks for
the dmi quirk (in callbacks) with a check for pctrl->chip.irq.init_valid_mask
I do believe that that is better then adding a need_validmask member to
the chv_pinctrl struct, I will prepare a v3 of the series with this change.
Regards,
Hans
next prev parent reply other threads:[~2019-11-13 18:53 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-06 15:47 [PATCH v2 0/3] pinctrl: cherryview: Pass irqchip when adding gpiochip Hans de Goede
2019-11-06 15:47 ` [PATCH v2 1/3] pinctrl: cherryview: Split out irq hw-init into a separate helper function Hans de Goede
2019-11-06 15:47 ` [PATCH v2 2/3] pinctrl: cherryview: Add GPIO <-> pin mapping ranges via callback Hans de Goede
2019-11-06 15:47 ` [PATCH v2 3/3] pinctrl: cherryview: Pass irqchip when adding gpiochip Hans de Goede
2019-11-06 16:16 ` Andy Shevchenko
2019-11-06 16:17 ` Andy Shevchenko
2019-11-13 18:52 ` Hans de Goede [this message]
2019-11-06 16:18 ` [PATCH v2 0/3] " Andy Shevchenko
2019-11-06 17:47 ` Mika Westerberg
2019-11-07 9:41 ` Andy Shevchenko
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=46a5e93d-b6d9-8c8d-647b-5a74840cea3d@redhat.com \
--to=hdegoede@redhat.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=bgolaszewski@baylibre.com \
--cc=linus.walleij@linaro.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-gpio@vger.kernel.org \
--cc=mika.westerberg@linux.intel.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).