Linux GPIO subsystem development
 help / color / mirror / Atom feed
From: Andrew Jeffery <andrew@aj.id.au>
To: Peter Rosin <peda@axentia.se>, linux-kernel@vger.kernel.org
Cc: Linus Walleij <linus.walleij@linaro.org>,
	Charles Keepax <ckeepax@opensource.cirrus.com>,
	linux-gpio@vger.kernel.org
Subject: Re: [PATCH 3/3] pinctrl: sx150x: add a static gpio/pinctrl pin range mapping
Date: Wed, 17 Jan 2018 09:05:54 -0600	[thread overview]
Message-ID: <1516201554.5522.15.camel@aj.id.au> (raw)
In-Reply-To: <20180117133423.4482-4-peda@axentia.se>

[-- Attachment #1: Type: text/plain, Size: 1671 bytes --]

On Wed, 2018-01-17 at 14:34 +0100, Peter Rosin wrote:
> Without such a range, gpiolib fails with -EPROBE_DEFER, pending the
> addition of the range. So, without a range, gpiolib will keep
> deferring indefinitely.
> 
> Fixes: e10f72bf4b3e ("gpio: gpiolib: Generalise state persistence beyond sleep")

This is a bit of a nit-pick, but I'd argue the hazard always existed in
the pinctrl-sx150x's probe however hadn't been triggered until now. My
instinct is Fixes should instead point to 9e80f9064e73 ("pinctrl: Add
SX150X GPIO Extender Pinctrl Driver"). Having said that I still think
it's worth pointing out in the commit message that e10f72bf4b3e ("gpio:
gpiolib: Generalise state persistence beyond sleep") is the motivation
for your patch (i.e. mention both commits).

Regardless, thanks to you both for getting to the bottom of this.

Andrew

> Suggested-by: Linus Walleij <linus.walleij@linaro.org>
> Signed-off-by: Peter Rosin <peda@axentia.se>
> ---
>  drivers/pinctrl/pinctrl-sx150x.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/drivers/pinctrl/pinctrl-sx150x.c b/drivers/pinctrl/pinctrl-sx150x.c
> index 049dd15e04ef..cbf58a10113d 100644
> --- a/drivers/pinctrl/pinctrl-sx150x.c
> +++ b/drivers/pinctrl/pinctrl-sx150x.c
> @@ -1193,6 +1193,11 @@ static int sx150x_probe(struct i2c_client *client,
>  	if (ret)
>  		return ret;
>  
> +	ret = gpiochip_add_pin_range(&pctl->gpio, dev_name(dev),
> +				     0, 0, pctl->data->npins);
> +	if (ret)
> +		return ret;
> +
>  	/* Add Interrupt support if an irq is specified */
>  	if (client->irq > 0) {
>  		pctl->irq_chip.name = devm_kstrdup(dev, client->name,

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 801 bytes --]

  reply	other threads:[~2018-01-17 15:06 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-16 21:47 [REGRESSION] mux/gpio.c is not able to get any gpio pins Peter Rosin
2018-01-16 23:18 ` Linus Walleij
2018-01-16 23:57   ` Peter Rosin
2018-01-17  9:35     ` Linus Walleij
2018-01-17 10:39       ` Peter Rosin
2018-01-17 13:27         ` Linus Walleij
2018-01-17 13:34           ` [PATCH 0/3] pinctrl: sx150x: fixes for the probe Peter Rosin
2018-01-17 13:34             ` [PATCH 1/3] pinctrl: sx150x: unregister the pinctrl on release Peter Rosin
2018-01-18  7:53               ` Linus Walleij
2018-01-17 13:34             ` [PATCH 2/3] pinctrl: sx150x: register pinctrl before adding the gpiochip Peter Rosin
2018-01-17 13:34             ` [PATCH 3/3] pinctrl: sx150x: add a static gpio/pinctrl pin range mapping Peter Rosin
2018-01-17 15:05               ` Andrew Jeffery [this message]
2018-01-17 15:27                 ` Peter Rosin
2018-01-18  7:58               ` Linus Walleij
2018-01-18  8:19                 ` Peter Rosin
2018-01-18 10:03                   ` 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=1516201554.5522.15.camel@aj.id.au \
    --to=andrew@aj.id.au \
    --cc=ckeepax@opensource.cirrus.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peda@axentia.se \
    /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