All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] gpio: rdc321x: Fix off-by-one for ngpio setting
@ 2014-04-24  2:13 Axel Lin
  2014-04-24 13:08 ` Linus Walleij
  0 siblings, 1 reply; 2+ messages in thread
From: Axel Lin @ 2014-04-24  2:13 UTC (permalink / raw)
  To: Linus Walleij; +Cc: Alexandre Courbot, Florian Fainelli, linux-gpio, Lee Jones

The valid gpio is GPIO0 ~ GPIO58, so ngpio should be 59.
This patch also renames RDC321X_MAX_GPIO to RDC321X_NUM_GPIO because it
actually means the number of available GPIOs.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
Hi Lee,
This actually fixes the ngpio setting in gpio-rdc321x driver.
So I think it makes sense to go via gpio tree.
Axel
 drivers/mfd/rdc321x-southbridge.c | 2 +-
 include/linux/mfd/rdc321x.h       | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/mfd/rdc321x-southbridge.c b/drivers/mfd/rdc321x-southbridge.c
index c795697..6575585 100644
--- a/drivers/mfd/rdc321x-southbridge.c
+++ b/drivers/mfd/rdc321x-southbridge.c
@@ -38,7 +38,7 @@ static struct resource rdc321x_wdt_resource[] = {
 };
 
 static struct rdc321x_gpio_pdata rdc321x_gpio_pdata = {
-	.max_gpios	= RDC321X_MAX_GPIO,
+	.max_gpios	= RDC321X_NUM_GPIO,
 };
 
 static struct resource rdc321x_gpio_resources[] = {
diff --git a/include/linux/mfd/rdc321x.h b/include/linux/mfd/rdc321x.h
index 4bdf19c..442743a 100644
--- a/include/linux/mfd/rdc321x.h
+++ b/include/linux/mfd/rdc321x.h
@@ -12,7 +12,7 @@
 #define RDC321X_GPIO_CTRL_REG2	0x84
 #define RDC321X_GPIO_DATA_REG2	0x88
 
-#define RDC321X_MAX_GPIO	58
+#define RDC321X_NUM_GPIO	59
 
 struct rdc321x_gpio_pdata {
 	struct pci_dev *sb_pdev;
-- 
1.8.3.2




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

* Re: [PATCH v2] gpio: rdc321x: Fix off-by-one for ngpio setting
  2014-04-24  2:13 [PATCH v2] gpio: rdc321x: Fix off-by-one for ngpio setting Axel Lin
@ 2014-04-24 13:08 ` Linus Walleij
  0 siblings, 0 replies; 2+ messages in thread
From: Linus Walleij @ 2014-04-24 13:08 UTC (permalink / raw)
  To: Axel Lin; +Cc: Alexandre Courbot, Florian Fainelli, linux-gpio, Lee Jones

On Thu, Apr 24, 2014 at 4:13 AM, Axel Lin <axel.lin@ingics.com> wrote:

> The valid gpio is GPIO0 ~ GPIO58, so ngpio should be 59.
> This patch also renames RDC321X_MAX_GPIO to RDC321X_NUM_GPIO because it
> actually means the number of available GPIOs.
>
> Signed-off-by: Axel Lin <axel.lin@ingics.com>
> ---
> Hi Lee,
> This actually fixes the ngpio setting in gpio-rdc321x driver.
> So I think it makes sense to go via gpio tree.

Nah, better to take this in MFD, and change $SUBJECT
to "mfd:".

Acked-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij

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

end of thread, other threads:[~2014-04-24 13:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-24  2:13 [PATCH v2] gpio: rdc321x: Fix off-by-one for ngpio setting Axel Lin
2014-04-24 13:08 ` Linus Walleij

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.