From: Lars Poeschel <larsi-myOXECIRRCL4ajHJ1XSv27NAH6kLmebB@public.gmane.org>
To: poeschel-Xtl8qvBWbHwb1SvskN2V4Q@public.gmane.org,
grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org,
rob.herring-bsGFqQB8/DxBDgjK7y7TUQ@public.gmane.org,
rob-VoJi6FS/r0vR7s880joybQ@public.gmane.org,
linus.walleij-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org,
devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org,
linux-doc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Cc: w.sang-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org,
ben-linux-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org,
linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: [PATCH 1/2] gpio: mcp23s08: Allow -1 as a legal value for global gpio base
Date: Wed, 6 Feb 2013 18:01:57 +0100 [thread overview]
Message-ID: <1360170118-11937-2-git-send-email-larsi@wh2.tu-dresden.de> (raw)
In-Reply-To: <1360170118-11937-1-git-send-email-larsi-myOXECIRRCL4ajHJ1XSv27NAH6kLmebB@public.gmane.org>
From: Lars Poeschel <poeschel-Xtl8qvBWbHwb1SvskN2V4Q@public.gmane.org>
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-Xtl8qvBWbHwb1SvskN2V4Q@public.gmane.org>
---
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;
}
@@ -570,7 +570,7 @@ static int mcp23s08_probe(struct spi_device *spi)
type = spi_get_device_id(spi)->driver_data;
pdata = spi->dev.platform_data;
- if (!pdata || !gpio_is_valid(pdata->base)) {
+ if ((!pdata || !gpio_is_valid(pdata->base)) && pdata->base != -1) {
dev_dbg(&spi->dev, "invalid or missing platform data\n");
return -EINVAL;
}
--
1.7.10.4
------------------------------------------------------------------------------
Free Next-Gen Firewall Hardware Offer
Buy your Sophos next-gen firewall before the end March 2013
and get the hardware for free! Learn more.
http://p.sf.net/sfu/sophos-d2d-feb
next prev parent reply other threads:[~2013-02-06 17:01 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-06 17:01 [PATCH 0/2] Convert mcp23s08 to DT usage Lars Poeschel
[not found] ` <1360170118-11937-1-git-send-email-larsi-myOXECIRRCL4ajHJ1XSv27NAH6kLmebB@public.gmane.org>
2013-02-06 17:01 ` Lars Poeschel [this message]
2013-02-09 14:27 ` [PATCH 1/2] gpio: mcp23s08: Allow -1 as a legal value for global gpio base Grant Likely
2013-02-06 17:01 ` [PATCH 2/2] gpio: mcp23s08: convert driver to DT 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=1360170118-11937-2-git-send-email-larsi@wh2.tu-dresden.de \
--to=larsi-myoxecirrcl4ajhj1xsv27nah6klmebb@public.gmane.org \
--cc=ben-linux-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org \
--cc=devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org \
--cc=grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org \
--cc=linus.walleij-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
--cc=linux-doc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=poeschel-Xtl8qvBWbHwb1SvskN2V4Q@public.gmane.org \
--cc=rob-VoJi6FS/r0vR7s880joybQ@public.gmane.org \
--cc=rob.herring-bsGFqQB8/DxBDgjK7y7TUQ@public.gmane.org \
--cc=spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
--cc=w.sang-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.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).