summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2015-12-07 13:19:19 (GMT)
committerLinus Walleij <linus.walleij@linaro.org>2016-01-05 10:21:12 (GMT)
commitff4cd029c184f5dabdfe9e115bf657ebd6a2c0f3 (patch)
treec89d52a30dcbb59a1675dfd468e26177260f3c3d
parent78132252cc4c6cecec25491a7bcfb6567bf29147 (diff)
downloadlinux-ff4cd029c184f5dabdfe9e115bf657ebd6a2c0f3.tar.xz
gpio: samsung: 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: Paul Bolle <pebolle@tiscali.nl> Cc: Kukjin Kim <kgene.kim@samsung.com> Acked-by: Tomasz Figa <tomasz.figa@gmail.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
-rw-r--r--drivers/gpio/gpio-samsung.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/gpio/gpio-samsung.c b/drivers/gpio/gpio-samsung.c
index 7c288ba..4cb4a31 100644
--- a/drivers/gpio/gpio-samsung.c
+++ b/drivers/gpio/gpio-samsung.c
@@ -753,7 +753,7 @@ static void __init samsung_gpiolib_add(struct samsung_gpio_chip *chip)
#endif
/* gpiochip_add() prints own failure message on error. */
- ret = gpiochip_add(gc);
+ ret = gpiochip_add_data(gc, chip);
if (ret >= 0)
s3c_gpiolib_track(chip);
}
@@ -862,7 +862,7 @@ static void __init samsung_gpiolib_add_4bit2_chips(struct samsung_gpio_chip *chi
int samsung_gpiolib_to_irq(struct gpio_chip *chip, unsigned int offset)
{
- struct samsung_gpio_chip *samsung_chip = container_of(chip, struct samsung_gpio_chip, chip);
+ struct samsung_gpio_chip *samsung_chip = gpiochip_get_data(chip);
return samsung_chip->irq_base + offset;
}