mfd: rdc321x: Fix off-by-one for ngpio setting
authorAxel Lin <axel.lin@ingics.com>
Fri, 25 Apr 2014 01:24:21 +0000 (09:24 +0800)
committerLee Jones <lee.jones@linaro.org>
Tue, 3 Jun 2014 07:11:17 +0000 (08:11 +0100)
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>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
drivers/mfd/rdc321x-southbridge.c
include/linux/mfd/rdc321x.h

index c79569750be9d1268c81dbfab12ed59573b01a35..6575585f1d1f0eed3933383d1432cbaa40ba8dbe 100644 (file)
@@ -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[] = {
index 4bdf19c8eedf110320c1f58ab25f77ec863388c7..442743a8f9153752661bf11a8dab9b998e55fe04 100644 (file)
@@ -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;