Commit 609f9692 authored by Linus Walleij's avatar Linus Walleij

gpio: mc33880: 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: default avatarLinus Walleij <linus.walleij@linaro.org>
parent 01f76b26
...@@ -71,7 +71,7 @@ static int __mc33880_set(struct mc33880 *mc, unsigned offset, int value) ...@@ -71,7 +71,7 @@ static int __mc33880_set(struct mc33880 *mc, unsigned offset, int value)
static void mc33880_set(struct gpio_chip *chip, unsigned offset, int value) static void mc33880_set(struct gpio_chip *chip, unsigned offset, int value)
{ {
struct mc33880 *mc = container_of(chip, struct mc33880, chip); struct mc33880 *mc = gpiochip_get_data(chip);
mutex_lock(&mc->lock); mutex_lock(&mc->lock);
...@@ -135,7 +135,7 @@ static int mc33880_probe(struct spi_device *spi) ...@@ -135,7 +135,7 @@ static int mc33880_probe(struct spi_device *spi)
goto exit_destroy; goto exit_destroy;
} }
ret = gpiochip_add(&mc->chip); ret = gpiochip_add_data(&mc->chip, mc);
if (ret) if (ret)
goto exit_destroy; goto exit_destroy;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment