Skip to contentSkip to conversation

gpio: rdc321x: Fix off-by-one for ngpio setting

PATCH In review Axel Lin 2 participants 2 messages Apr 24, 2014

Subsystems (2)
lore
Share & tools
lore

Axel Lin

author
#0 lore raw

PATCH v2 1/1 gpio: rdc321x: Fix off-by-one for ngpio setting

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.

---
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(-)
drivers/mfd/rdc321x-southbridge.c +1 -1
index c795697..6575585 100644
@@ -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[] = {
include/linux/mfd/rdc321x.h +1 -1
index 4bdf19c..442743a 100644
@@ -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;
Signature · 1 line
1.8.3.2
Acked-by on v2 1/1
#1 lore raw
Quoted 9 lines · Axel Lin

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.

---
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:".

Yours,
Linus Walleij