This makes the driver use the data pointer added to the gpio_chip
to store a pointer to the state container instead of relying on
container_of().

Cc: Robert Jarzmik <robert.jarz...@free.fr>
Cc: Daniel Mack <zon...@gmail.com>
Signed-off-by: Linus Walleij <linus.wall...@linaro.org>
---
 drivers/gpio/gpio-pxa.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/gpio/gpio-pxa.c b/drivers/gpio/gpio-pxa.c
index bce99182578b..1f574a9f88fe 100644
--- a/drivers/gpio/gpio-pxa.c
+++ b/drivers/gpio/gpio-pxa.c
@@ -153,7 +153,8 @@ static struct pxa_gpio_id pxa1928_id = {
 
 static inline void __iomem *gpio_chip_base(struct gpio_chip *c)
 {
-       return container_of(c, struct pxa_gpio_chip, chip)->regbase;
+       struct pxa_gpio_chip *p = gpiochip_get_data(c);
+       return p->regbase;
 }
 
 static inline struct pxa_gpio_chip *gpio_to_pxachip(unsigned gpio)
@@ -334,7 +335,7 @@ static int pxa_init_gpio_chip(int gpio_end,
 
                /* number of GPIOs on last bank may be less than 32 */
                c->ngpio = (gpio + 31 > gpio_end) ? (gpio_end - gpio + 1) : 32;
-               gpiochip_add(c);
+               gpiochip_add_data(c, &chips[i]);
        }
        pxa_gpio_chips = chips;
        return 0;
-- 
2.4.3

--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to