From 6219e7bba9d52ea5d40cd50d0cfe6059c2630fab Mon Sep 17 00:00:00 2001 From: Linus Walleij Date: Sun, 6 Dec 2015 00:36:39 +0100 Subject: 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 Cc: Magnus Damm Signed-off-by: Linus Walleij --- drivers/gpio/gpio-em.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers/gpio/gpio-em.c') diff --git a/drivers/gpio/gpio-em.c b/drivers/gpio/gpio-em.c index d726c68c4a65..8d32ccc980d9 100644 --- a/drivers/gpio/gpio-em.c +++ b/drivers/gpio/gpio-em.c @@ -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; -- cgit v1.2.3