mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Alexandre Torgue <alexandre.torgue@st.com>
To: Amelie Delaunay <amelie.delaunay@st.com>,
	Linus Walleij <linus.walleij@linaro.org>,
	Maxime Coquelin <mcoquelin.stm32@gmail.com>
Cc: <linux-gpio@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<linux-arm-kernel@lists.infradead.org>,
	<linux-stm32@st-md-mailman.stormreply.com>
Subject: Re: [PATCH 1/1] pinctrl: stmfx: fix valid_mask init sequence
Date: Mon, 4 Nov 2019 11:22:07 +0100	[thread overview]
Message-ID: <3767f869-7454-c230-5e6c-487b436cb58f@st.com> (raw)
In-Reply-To: <20191104100908.10880-1-amelie.delaunay@st.com>

Hi Amélie,

On 11/4/19 11:09 AM, Amelie Delaunay wrote:
> With stmfx_pinctrl_gpio_init_valid_mask callback, gpio_valid_mask was used
> to initialize gpiochip valid_mask for gpiolib. But gpio_valid_mask was not
> yet initialized. gpio_valid_mask required gpio-ranges to be registered,
> this is the case after gpiochip_add_data call. But init_valid_mask
> callback is also called under gpiochip_add_data. gpio_valid_mask
> initialization cannot be moved before gpiochip_add_data because
> gpio-ranges are not registered.
> So, it is not possible to use init_valid_mask callback.
> To avoid this issue, get rid of valid_mask and rely on ranges.
> 
> Fixes: da9b142ab2c5 ("pinctrl: stmfx: Use the callback to populate valid_mask")
> Signed-off-by: Amelie Delaunay <amelie.delaunay@st.com>

Acked-by: Alexandre TORGUE <alexandre.torgue@st.com>

> ---
>   drivers/pinctrl/pinctrl-stmfx.c | 14 --------------
>   1 file changed, 14 deletions(-)
> 
> diff --git a/drivers/pinctrl/pinctrl-stmfx.c b/drivers/pinctrl/pinctrl-stmfx.c
> index 564660028fcc..ccdf0bb21414 100644
> --- a/drivers/pinctrl/pinctrl-stmfx.c
> +++ b/drivers/pinctrl/pinctrl-stmfx.c
> @@ -585,19 +585,6 @@ static int stmfx_pinctrl_gpio_function_enable(struct stmfx_pinctrl *pctl)
>   	return stmfx_function_enable(pctl->stmfx, func);
>   }
>   
> -static int stmfx_pinctrl_gpio_init_valid_mask(struct gpio_chip *gc,
> -					      unsigned long *valid_mask,
> -					      unsigned int ngpios)
> -{
> -	struct stmfx_pinctrl *pctl = gpiochip_get_data(gc);
> -	u32 n;
> -
> -	for_each_clear_bit(n, &pctl->gpio_valid_mask, ngpios)
> -		clear_bit(n, valid_mask);
> -
> -	return 0;
> -}
> -
>   static int stmfx_pinctrl_probe(struct platform_device *pdev)
>   {
>   	struct stmfx *stmfx = dev_get_drvdata(pdev->dev.parent);
> @@ -660,7 +647,6 @@ static int stmfx_pinctrl_probe(struct platform_device *pdev)
>   	pctl->gpio_chip.ngpio = pctl->pctl_desc.npins;
>   	pctl->gpio_chip.can_sleep = true;
>   	pctl->gpio_chip.of_node = np;
> -	pctl->gpio_chip.init_valid_mask = stmfx_pinctrl_gpio_init_valid_mask;
>   
>   	ret = devm_gpiochip_add_data(pctl->dev, &pctl->gpio_chip, pctl);
>   	if (ret) {
> 

  reply	other threads:[~2019-11-04 10:22 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-04 10:09 Amelie Delaunay
2019-11-04 10:22 ` Alexandre Torgue [this message]
2019-11-05 14:32 ` Linus Walleij
2019-11-05 15:14   ` Amelie DELAUNAY
2019-11-07  9:09     ` Linus Walleij
2019-11-07  9:24       ` Amelie DELAUNAY
2019-11-07  9:07 ` 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=3767f869-7454-c230-5e6c-487b436cb58f@st.com \
    --to=alexandre.torgue@st.com \
    --cc=amelie.delaunay@st.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-stm32@st-md-mailman.stormreply.com \
    --cc=mcoquelin.stm32@gmail.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

all inboxes | Powered by JetHome®