linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Patrice CHOTARD <patrice.chotard@st.com>
To: Linus Walleij <linus.walleij@linaro.org>,
	"linux-gpio@vger.kernel.org" <linux-gpio@vger.kernel.org>
Cc: Bartosz Golaszewski <bgolaszewski@baylibre.com>,
	Alexandre TORGUE <alexandre.torgue@st.com>
Subject: Re: [PATCH] gpio: stmpe: Use irqchip template
Date: Mon, 27 Jul 2020 12:32:29 +0000	[thread overview]
Message-ID: <77d9f7b1-b4f4-ab40-8a2c-0515a5280ce6@st.com> (raw)
In-Reply-To: <20200716100638.112451-1-linus.walleij@linaro.org>

Hi Linus

On 7/16/20 12:06 PM, 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.
>
> Cc: Patrice Chotard <patrice.chotard@st.com>
> Cc: Alexandre TORGUE <alexandre.torgue@st.com>
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
> ---
>  drivers/gpio/gpio-stmpe.c | 24 +++++++++++-------------
>  1 file changed, 11 insertions(+), 13 deletions(-)
>
> diff --git a/drivers/gpio/gpio-stmpe.c b/drivers/gpio/gpio-stmpe.c
> index 542706a852e6..395ee51445ea 100644
> --- a/drivers/gpio/gpio-stmpe.c
> +++ b/drivers/gpio/gpio-stmpe.c
> @@ -507,6 +507,8 @@ static int stmpe_gpio_probe(struct platform_device *pdev)
>  	}
>  
>  	if (irq > 0) {
> +		struct gpio_irq_chip *girq;
> +
>  		ret = devm_request_threaded_irq(&pdev->dev, irq, NULL,
>  				stmpe_gpio_irq, IRQF_ONESHOT,
>  				"stmpe-gpio", stmpe_gpio);
> @@ -514,20 +516,16 @@ static int stmpe_gpio_probe(struct platform_device *pdev)
>  			dev_err(&pdev->dev, "unable to get irq: %d\n", ret);
>  			goto out_disable;
>  		}
> -		ret =  gpiochip_irqchip_add_nested(&stmpe_gpio->chip,
> -						   &stmpe_gpio_irq_chip,
> -						   0,
> -						   handle_simple_irq,
> -						   IRQ_TYPE_NONE);
> -		if (ret) {
> -			dev_err(&pdev->dev,
> -				"could not connect irqchip to gpiochip\n");
> -			goto out_disable;
> -		}
>  
> -		gpiochip_set_nested_irqchip(&stmpe_gpio->chip,
> -					    &stmpe_gpio_irq_chip,
> -					    irq);
> +		girq = &stmpe_gpio->chip.irq;
> +		girq->chip = &stmpe_gpio_irq_chip;
> +		/* 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;
>  	}
>  
>  	platform_set_drvdata(pdev, stmpe_gpio);

Reviewed-by: Patrice Chotard <patrice.chotard@st.com>

Thanks

  reply	other threads:[~2020-07-27 12:32 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-16 10:06 [PATCH] gpio: stmpe: Use irqchip template Linus Walleij
2020-07-27 12:32 ` Patrice CHOTARD [this message]
2020-07-27 21:13 ` Serge Semin
2020-07-28  7:28   ` Linus Walleij

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=77d9f7b1-b4f4-ab40-8a2c-0515a5280ce6@st.com \
    --to=patrice.chotard@st.com \
    --cc=alexandre.torgue@st.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;
as well as URLs for NNTP newsgroup(s).