aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWilliam Breathitt Gray <vilhelm.gray@gmail.com>2018-04-18 08:53:10 -0400
committerLinus Walleij <linus.walleij@linaro.org>2018-04-26 18:55:16 -0400
commitaaf96e51de117cdfa2dc04735639895b46a3da3f (patch)
tree9d8055ff94df699543ae6a489e570327d0f1dd2a
parentf001cc351ad3309ec8736c374e90e5a4bc472d41 (diff)
gpio: pci-idio-16: Fix port memory offset for get_multiple callback
The ioread8 function expects a memory offset argument. This patch fixes the ports array to provide the memory addresses of the respective device I/O registers. Fixes: 810ebfc5efca ("gpio: pci-idio-16: Implement get_multiple callback") Signed-off-by: William Breathitt Gray <vilhelm.gray@gmail.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
-rw-r--r--drivers/gpio/gpio-pci-idio-16.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/gpio/gpio-pci-idio-16.c b/drivers/gpio/gpio-pci-idio-16.c
index 1948724d8c36..25d16b2af1c3 100644
--- a/drivers/gpio/gpio-pci-idio-16.c
+++ b/drivers/gpio/gpio-pci-idio-16.c
@@ -116,9 +116,9 @@ static int idio_16_gpio_get_multiple(struct gpio_chip *chip,
116 unsigned long word_mask; 116 unsigned long word_mask;
117 const unsigned long port_mask = GENMASK(gpio_reg_size - 1, 0); 117 const unsigned long port_mask = GENMASK(gpio_reg_size - 1, 0);
118 unsigned long port_state; 118 unsigned long port_state;
119 u8 __iomem ports[] = { 119 void __iomem *ports[] = {
120 idio16gpio->reg->out0_7, idio16gpio->reg->out8_15, 120 &idio16gpio->reg->out0_7, &idio16gpio->reg->out8_15,
121 idio16gpio->reg->in0_7, idio16gpio->reg->in8_15, 121 &idio16gpio->reg->in0_7, &idio16gpio->reg->in8_15,
122 }; 122 };
123 123
124 /* clear bits array to a clean slate */ 124 /* clear bits array to a clean slate */
@@ -143,7 +143,7 @@ static int idio_16_gpio_get_multiple(struct gpio_chip *chip,
143 } 143 }
144 144
145 /* read bits from current gpio port */ 145 /* read bits from current gpio port */
146 port_state = ioread8(ports + i); 146 port_state = ioread8(ports[i]);
147 147
148 /* store acquired bits at respective bits array offset */ 148 /* store acquired bits at respective bits array offset */
149 bits[word_index] |= port_state << word_offset; 149 bits[word_index] |= port_state << word_offset;