Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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

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>

authored by

Axel Lin and committed by
Lee Jones
1ec93b9b 51f1f1cb

+2 -2
+1 -1
drivers/mfd/rdc321x-southbridge.c
··· 38 38 }; 39 39 40 40 static struct rdc321x_gpio_pdata rdc321x_gpio_pdata = { 41 - .max_gpios = RDC321X_MAX_GPIO, 41 + .max_gpios = RDC321X_NUM_GPIO, 42 42 }; 43 43 44 44 static struct resource rdc321x_gpio_resources[] = {
+1 -1
include/linux/mfd/rdc321x.h
··· 12 12 #define RDC321X_GPIO_CTRL_REG2 0x84 13 13 #define RDC321X_GPIO_DATA_REG2 0x88 14 14 15 - #define RDC321X_MAX_GPIO 58 15 + #define RDC321X_NUM_GPIO 59 16 16 17 17 struct rdc321x_gpio_pdata { 18 18 struct pci_dev *sb_pdev;