Linux GPIO subsystem development
 help / color / mirror / Atom feed
From: Axel Lin <axel.lin@ingics.com>
To: Linus Walleij <linus.walleij@linaro.org>,
	Alexandre Courbot <gnurou@gmail.com>
Cc: Florian Fainelli <florian@openwrt.org>, linux-gpio@vger.kernel.org
Subject: [PATCH 1/2] gpio: rdc321x: Fix off-by-one for ngpio setting
Date: Fri, 11 Apr 2014 14:14:45 +0800	[thread overview]
Message-ID: <1397196885.12922.2.camel@phoenix> (raw)

The valid gpio is GPIO0 ~ GPIO58, so ngpio should be RDC321X_MAX_GPIO + 1.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
 drivers/gpio/gpio-rdc321x.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpio/gpio-rdc321x.c b/drivers/gpio/gpio-rdc321x.c
index 88577c3..9e7da2d 100644
--- a/drivers/gpio/gpio-rdc321x.c
+++ b/drivers/gpio/gpio-rdc321x.c
@@ -176,7 +176,7 @@ static int rdc321x_gpio_probe(struct platform_device *pdev)
 	rdc321x_gpio_dev->chip.get = rdc_gpio_get_value;
 	rdc321x_gpio_dev->chip.set = rdc_gpio_set_value;
 	rdc321x_gpio_dev->chip.base = 0;
-	rdc321x_gpio_dev->chip.ngpio = pdata->max_gpios;
+	rdc321x_gpio_dev->chip.ngpio = pdata->max_gpios + 1;
 
 	platform_set_drvdata(pdev, rdc321x_gpio_dev);
 
-- 
1.8.3.2




             reply	other threads:[~2014-04-11  6:14 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-11  6:14 Axel Lin [this message]
2014-04-11  6:16 ` [PATCH 2/2] gpio: rdc321x: Convert to use devm_kzalloc Axel Lin
2014-04-20 18:32   ` Florian Fainelli
2014-04-23 13:27   ` Linus Walleij
2014-04-20 18:31 ` [PATCH 1/2] gpio: rdc321x: Fix off-by-one for ngpio setting Florian Fainelli
2014-04-23 13:25 ` Linus Walleij
2014-04-23 14:00   ` Axel Lin
2014-04-23 21:53     ` Linus Walleij
2014-04-23 21:55       ` Florian Fainelli

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=1397196885.12922.2.camel@phoenix \
    --to=axel.lin@ingics.com \
    --cc=florian@openwrt.org \
    --cc=gnurou@gmail.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