From: "Kuppuswamy, Sathyanarayanan" <sathyanarayanan.kuppuswamy@linux.intel.com>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Linus Walleij <linus.walleij@linaro.org>,
linux-gpio@vger.kernel.org,
Bartosz Golaszewski <bgolaszewski@baylibre.com>,
Hans de Goede <hdegoede@redhat.com>
Subject: Re: [PATCH v2] gpio: crystalcove: Use irqchip template
Date: Tue, 21 Jul 2020 15:05:56 -0700 [thread overview]
Message-ID: <9a0ddc8a-8c8f-614f-56ed-3e59e9fb60f0@linux.intel.com> (raw)
In-Reply-To: <20200721215411.GR3703480@smile.fi.intel.com>
On 7/21/20 2:54 PM, Andy Shevchenko wrote:
> On Tue, Jul 21, 2020 at 10:08:57AM -0700, Kuppuswamy, Sathyanarayanan wrote:
>> Hi,
>>
>> On 7/21/20 7:01 AM, Linus Walleij wrote:
>>> This makes the driver use the irqchip template to assign
>>> properties to the gpio_irq_chip instead of using the
>>> explicit calls to gpiochip_irqchip_add_nested() and
>>> gpiochip_set_nested_irqchip(). The irqchip is instead
>>> added while adding the gpiochip.
>> Looks good to me.
>
> Thanks!
>
>> Reviewed-by: Kuppuswamy Sathyanarayanan
>> <sathyanarayanan.kuppuswamy@linux.intel.com>
>
> It's not first time your tag goes like this. Please, fix your tools to be it like
> Reviewed-by: Name <address@com>
> (no leading spaces, no split -- one line)
Ok. I will fix it in future emails.
>
>>> Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
>>> Cc: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
>>> Cc: Hans de Goede <hdegoede@redhat.com>
>>> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
>>> ---
>>> ChangeLog v1->V2:
>>> - Fixed a variable name ch->cg
>>> ---
>>> drivers/gpio/gpio-crystalcove.c | 24 +++++++++++++++---------
>>> 1 file changed, 15 insertions(+), 9 deletions(-)
>>>
>>> diff --git a/drivers/gpio/gpio-crystalcove.c b/drivers/gpio/gpio-crystalcove.c
>>> index 14d1f4c933b6..39349b0e6923 100644
>>> --- a/drivers/gpio/gpio-crystalcove.c
>>> +++ b/drivers/gpio/gpio-crystalcove.c
>>> @@ -330,6 +330,7 @@ static int crystalcove_gpio_probe(struct platform_device *pdev)
>>> int retval;
>>> struct device *dev = pdev->dev.parent;
>>> struct intel_soc_pmic *pmic = dev_get_drvdata(dev);
>>> + struct gpio_irq_chip *girq;
>>> if (irq < 0)
>>> return irq;
>>> @@ -353,14 +354,15 @@ static int crystalcove_gpio_probe(struct platform_device *pdev)
>>> cg->chip.dbg_show = crystalcove_gpio_dbg_show;
>>> cg->regmap = pmic->regmap;
>>> - retval = devm_gpiochip_add_data(&pdev->dev, &cg->chip, cg);
>>> - if (retval) {
>>> - dev_warn(&pdev->dev, "add gpio chip error: %d\n", retval);
>>> - return retval;
>>> - }
>>> -
>>> - gpiochip_irqchip_add_nested(&cg->chip, &crystalcove_irqchip, 0,
>>> - handle_simple_irq, IRQ_TYPE_NONE);
>>> + girq = &cg->chip.irq;
>>> + girq->chip = &crystalcove_irqchip;
>>> + /* This will let us handle the parent IRQ in the driver */
>>> + girq->parent_handler = NULL;
>>> + girq->num_parents = 0;
>>> + girq->parents = NULL;
>>> + girq->default_type = IRQ_TYPE_NONE;
>>> + girq->handler = handle_simple_irq;
>>> + girq->threaded = true;
>>> retval = request_threaded_irq(irq, NULL, crystalcove_gpio_irq_handler,
>>> IRQF_ONESHOT, KBUILD_MODNAME, cg);
>>> @@ -370,7 +372,11 @@ static int crystalcove_gpio_probe(struct platform_device *pdev)
>>> return retval;
>>> }
>>> - gpiochip_set_nested_irqchip(&cg->chip, &crystalcove_irqchip, irq);
>>> + retval = devm_gpiochip_add_data(&pdev->dev, &cg->chip, cg);
>>> + if (retval) {
>>> + dev_warn(&pdev->dev, "add gpio chip error: %d\n", retval);
>>> + return retval;
>>> + }
>>> return 0;
>>> }
>>>
>>
>> --
>> Sathyanarayanan Kuppuswamy
>> Linux Kernel Developer
>
--
Sathyanarayanan Kuppuswamy
Linux Kernel Developer
prev parent reply other threads:[~2020-07-21 22:05 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-21 14:01 [PATCH v2] gpio: crystalcove: Use irqchip template Linus Walleij
2020-07-21 15:39 ` Andy Shevchenko
2020-07-21 15:58 ` Andy Shevchenko
2020-07-22 8:56 ` Hans de Goede
2020-07-22 8:59 ` Andy Shevchenko
2020-07-22 9:00 ` Andy Shevchenko
2020-07-21 17:08 ` Kuppuswamy, Sathyanarayanan
2020-07-21 21:54 ` Andy Shevchenko
2020-07-21 22:05 ` Kuppuswamy, Sathyanarayanan [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=9a0ddc8a-8c8f-614f-56ed-3e59e9fb60f0@linux.intel.com \
--to=sathyanarayanan.kuppuswamy@linux.intel.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=bgolaszewski@baylibre.com \
--cc=hdegoede@redhat.com \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.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 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).