gpio: em: use gpiochip data pointer
authorLinus Walleij <linus.walleij@linaro.org>
Sat, 5 Dec 2015 23:36:39 +0000 (00:36 +0100)
committerLinus Walleij <linus.walleij@linaro.org>
Tue, 5 Jan 2016 10:21:05 +0000 (11:21 +0100)
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: Geert Uytterhoeven <geert+renesas@glider.be>
Cc: Magnus Damm <damm@opensource.se>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/gpio/gpio-em.c

index d726c68c4a65d779c8e34859ca2aff63f249ee8f..8d32ccc980d9ecf963a0cd2ef91b4dd5f5debc7d 100644 (file)
@@ -192,7 +192,7 @@ static irqreturn_t em_gio_irq_handler(int irq, void *dev_id)
 
 static inline struct em_gio_priv *gpio_to_priv(struct gpio_chip *chip)
 {
-       return container_of(chip, struct em_gio_priv, gpio_chip);
+       return gpiochip_get_data(chip);
 }
 
 static int em_gio_direction_input(struct gpio_chip *chip, unsigned offset)
@@ -368,7 +368,7 @@ static int em_gio_probe(struct platform_device *pdev)
                goto err1;
        }
 
-       ret = gpiochip_add(gpio_chip);
+       ret = gpiochip_add_data(gpio_chip, p);
        if (ret) {
                dev_err(&pdev->dev, "failed to add GPIO controller\n");
                goto err1;
This page took 0.024188 seconds and 5 git commands to generate.