Linux GPIO subsystem development
 help / color / mirror / Atom feed
From: Dmitry Osipenko <digetx@gmail.com>
To: Linus Walleij <linus.walleij@linaro.org>, linux-gpio@vger.kernel.org
Cc: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Subject: Re: [PATCH] gpio: max77620: Use helper variable and clarify
Date: Thu, 16 Jul 2020 22:17:23 +0300	[thread overview]
Message-ID: <6e758c01-2eef-67b7-7f4e-537b7dd85494@gmail.com> (raw)
In-Reply-To: <20200716092835.69176-1-linus.walleij@linaro.org>

16.07.2020 12:28, Linus Walleij пишет:
> Most other drivers fill out the gpio_irq_chip using a
> struct gpio_irq_chip *girq helper variable for ease of
> reading.
> 
> We also make a habit of explicitly assigning NULL and
> zero to the parent IRQs when using ordinary IRQ handlers
> in the driver, mostly for code readability and
> maintenance.
> 
> Cc: Dmitry Osipenko <digetx@gmail.com>
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
> ---
>  drivers/gpio/gpio-max77620.c | 16 +++++++++++-----
>  1 file changed, 11 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/gpio/gpio-max77620.c b/drivers/gpio/gpio-max77620.c
> index e090979659eb..7c0a9ef0b500 100644
> --- a/drivers/gpio/gpio-max77620.c
> +++ b/drivers/gpio/gpio-max77620.c
> @@ -288,6 +288,7 @@ static int max77620_gpio_probe(struct platform_device *pdev)
>  {
>  	struct max77620_chip *chip =  dev_get_drvdata(pdev->dev.parent);
>  	struct max77620_gpio *mgpio;
> +	struct gpio_irq_chip *girq;
>  	unsigned int gpio_irq;
>  	int ret;
>  
> @@ -316,11 +317,16 @@ static int max77620_gpio_probe(struct platform_device *pdev)
>  	mgpio->gpio_chip.can_sleep = 1;
>  	mgpio->gpio_chip.base = -1;
>  
> -	mgpio->gpio_chip.irq.chip = &max77620_gpio_irqchip;
> -	mgpio->gpio_chip.irq.default_type = IRQ_TYPE_NONE;
> -	mgpio->gpio_chip.irq.handler = handle_edge_irq;
> -	mgpio->gpio_chip.irq.init_hw = max77620_gpio_irq_init_hw,
> -	mgpio->gpio_chip.irq.threaded = true;
> +	girq = &mgpio->gpio_chip.irq;
> +	girq->chip = &max77620_gpio_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_edge_irq;
> +	girq->init_hw = max77620_gpio_irq_init_hw,
> +	girq->threaded = true;
>  
>  	platform_set_drvdata(pdev, mgpio);
>  
> 

Thanks :)

Reviewed-by: Dmitry Osipenko <digetx@gmail.com>

      reply	other threads:[~2020-07-16 19:17 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-16  9:28 [PATCH] gpio: max77620: Use helper variable and clarify Linus Walleij
2020-07-16 19:17 ` Dmitry Osipenko [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=6e758c01-2eef-67b7-7f4e-537b7dd85494@gmail.com \
    --to=digetx@gmail.com \
    --cc=bgolaszewski@baylibre.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