linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] gpio: rdc321x: Fix off-by-one for ngpio setting
@ 2014-04-11  6:14 Axel Lin
  2014-04-11  6:16 ` [PATCH 2/2] gpio: rdc321x: Convert to use devm_kzalloc Axel Lin
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Axel Lin @ 2014-04-11  6:14 UTC (permalink / raw)
  To: Linus Walleij, Alexandre Courbot; +Cc: Florian Fainelli, linux-gpio

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




^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2014-04-23 21:55 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-11  6:14 [PATCH 1/2] gpio: rdc321x: Fix off-by-one for ngpio setting Axel Lin
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

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).