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

gpio: em: use gpiochip data pointer

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>

+2 -2
+2 -2
drivers/gpio/gpio-em.c
··· 192 192 193 193 static inline struct em_gio_priv *gpio_to_priv(struct gpio_chip *chip) 194 194 { 195 - return container_of(chip, struct em_gio_priv, gpio_chip); 195 + return gpiochip_get_data(chip); 196 196 } 197 197 198 198 static int em_gio_direction_input(struct gpio_chip *chip, unsigned offset) ··· 368 368 goto err1; 369 369 } 370 370 371 - ret = gpiochip_add(gpio_chip); 371 + ret = gpiochip_add_data(gpio_chip, p); 372 372 if (ret) { 373 373 dev_err(&pdev->dev, "failed to add GPIO controller\n"); 374 374 goto err1;