All of lore.kernel.org
 help / color / mirror / Atom feed
From: Grant Likely <grant.likely@secretlab.ca>
To: Lars Poeschel <larsi@wh2.tu-dresden.de>,
	poeschel@lemonage.de, rob.herring@calxeda.com, rob@landley.net,
	linus.walleij@linaro.org, devicetree-discuss@lists.ozlabs.org,
	linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
	spi-devel-general@lists.sourceforge.net
Cc: w.sang@pengutronix.de, ben-linux@fluff.org, linux-i2c@vger.kernel.org
Subject: Re: [PATCH 1/2] gpio: mcp23s08: Allow -1 as a legal value for global gpio base
Date: Sat, 09 Feb 2013 14:27:08 +0000	[thread overview]
Message-ID: <20130209142708.8E9AC3E30EC@localhost> (raw)
In-Reply-To: <1360170118-11937-2-git-send-email-larsi@wh2.tu-dresden.de>

On Wed,  6 Feb 2013 18:01:57 +0100, Lars Poeschel <larsi@wh2.tu-dresden.de> wrote:
> From: Lars Poeschel <poeschel@lemonage.de>
> 
> Explicitly allow -1 as a legal value for the
> mcp23s08_platform_data->base. This is the special value lets the
> kernel choose a valid global gpio base number.
> 
> Signed-off-by: Lars Poeschel <poeschel@lemonage.de>
> ---
>  drivers/gpio/gpio-mcp23s08.c |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpio/gpio-mcp23s08.c b/drivers/gpio/gpio-mcp23s08.c
> index 3cea0ea..2afb828 100644
> --- a/drivers/gpio/gpio-mcp23s08.c
> +++ b/drivers/gpio/gpio-mcp23s08.c
> @@ -483,7 +483,7 @@ static int mcp230xx_probe(struct i2c_client *client,
>  	int status;
>  
>  	pdata = client->dev.platform_data;
> -	if (!pdata || !gpio_is_valid(pdata->base)) {
> +	if ((!pdata || !gpio_is_valid(pdata->base)) && pdata->base != -1) {
>  		dev_dbg(&client->dev, "invalid or missing platform data\n");
>  		return -EINVAL;

When used with the device tree you shouldn't have a platform data
pointer at all. Instead you should modify the driver to not require it.

g.


  reply	other threads:[~2013-02-09 14:27 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-06 17:01 [PATCH 0/2] Convert mcp23s08 to DT usage Lars Poeschel
2013-02-06 17:01 ` [PATCH 1/2] gpio: mcp23s08: Allow -1 as a legal value for global gpio base Lars Poeschel
2013-02-06 17:01   ` Lars Poeschel
2013-02-09 14:27   ` Grant Likely [this message]
2013-02-06 17:01 ` [PATCH 2/2] gpio: mcp23s08: convert driver to DT Lars Poeschel
2013-02-06 17:01   ` Lars Poeschel
2013-02-09 14:31   ` Grant Likely

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=20130209142708.8E9AC3E30EC@localhost \
    --to=grant.likely@secretlab.ca \
    --cc=ben-linux@fluff.org \
    --cc=devicetree-discuss@lists.ozlabs.org \
    --cc=larsi@wh2.tu-dresden.de \
    --cc=linus.walleij@linaro.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=poeschel@lemonage.de \
    --cc=rob.herring@calxeda.com \
    --cc=rob@landley.net \
    --cc=spi-devel-general@lists.sourceforge.net \
    --cc=w.sang@pengutronix.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.