diff options
author | Linus Walleij <linus.walleij@linaro.org> | 2015-12-07 08:43:28 -0500 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2016-01-05 05:21:15 -0500 |
commit | 92a41e2f73879373a4ce2df4b2137d03ba1289ec (patch) | |
tree | 329686315e14492b1f2e992dccf7c83462628a4d /drivers/gpio | |
parent | b0d384733c05906b807cbb9a1b732ad12b521dbe (diff) |
gpio: timberdale: 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().
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/gpio')
-rw-r--r-- | drivers/gpio/gpio-timberdale.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/gpio/gpio-timberdale.c b/drivers/gpio/gpio-timberdale.c index dda8f21811eb..a6de10c5275b 100644 --- a/drivers/gpio/gpio-timberdale.c +++ b/drivers/gpio/gpio-timberdale.c | |||
@@ -53,7 +53,7 @@ struct timbgpio { | |||
53 | static int timbgpio_update_bit(struct gpio_chip *gpio, unsigned index, | 53 | static int timbgpio_update_bit(struct gpio_chip *gpio, unsigned index, |
54 | unsigned offset, bool enabled) | 54 | unsigned offset, bool enabled) |
55 | { | 55 | { |
56 | struct timbgpio *tgpio = container_of(gpio, struct timbgpio, gpio); | 56 | struct timbgpio *tgpio = gpiochip_get_data(gpio); |
57 | u32 reg; | 57 | u32 reg; |
58 | 58 | ||
59 | spin_lock(&tgpio->lock); | 59 | spin_lock(&tgpio->lock); |
@@ -77,7 +77,7 @@ static int timbgpio_gpio_direction_input(struct gpio_chip *gpio, unsigned nr) | |||
77 | 77 | ||
78 | static int timbgpio_gpio_get(struct gpio_chip *gpio, unsigned nr) | 78 | static int timbgpio_gpio_get(struct gpio_chip *gpio, unsigned nr) |
79 | { | 79 | { |
80 | struct timbgpio *tgpio = container_of(gpio, struct timbgpio, gpio); | 80 | struct timbgpio *tgpio = gpiochip_get_data(gpio); |
81 | u32 value; | 81 | u32 value; |
82 | 82 | ||
83 | value = ioread32(tgpio->membase + TGPIOVAL); | 83 | value = ioread32(tgpio->membase + TGPIOVAL); |
@@ -98,7 +98,7 @@ static void timbgpio_gpio_set(struct gpio_chip *gpio, | |||
98 | 98 | ||
99 | static int timbgpio_to_irq(struct gpio_chip *gpio, unsigned offset) | 99 | static int timbgpio_to_irq(struct gpio_chip *gpio, unsigned offset) |
100 | { | 100 | { |
101 | struct timbgpio *tgpio = container_of(gpio, struct timbgpio, gpio); | 101 | struct timbgpio *tgpio = gpiochip_get_data(gpio); |
102 | 102 | ||
103 | if (tgpio->irq_base <= 0) | 103 | if (tgpio->irq_base <= 0) |
104 | return -EINVAL; | 104 | return -EINVAL; |
@@ -279,7 +279,7 @@ static int timbgpio_probe(struct platform_device *pdev) | |||
279 | gc->ngpio = pdata->nr_pins; | 279 | gc->ngpio = pdata->nr_pins; |
280 | gc->can_sleep = false; | 280 | gc->can_sleep = false; |
281 | 281 | ||
282 | err = gpiochip_add(gc); | 282 | err = gpiochip_add_data(gc, tgpio); |
283 | if (err) | 283 | if (err) |
284 | return err; | 284 | return err; |
285 | 285 | ||