Commit 41f6f8ec authored by Linus Walleij's avatar Linus Walleij

MIPS: rb532: 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: linux-mips@linux-mips.org
Acked-by: default avatarRalf Baechle <ralf@linux-mips.org>
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent d98312f7
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
#include <linux/export.h> #include <linux/export.h>
#include <linux/spinlock.h> #include <linux/spinlock.h>
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <linux/gpio.h> #include <linux/gpio/driver.h>
#include <asm/mach-rc32434/rb.h> #include <asm/mach-rc32434/rb.h>
#include <asm/mach-rc32434/gpio.h> #include <asm/mach-rc32434/gpio.h>
...@@ -88,7 +88,7 @@ static int rb532_gpio_get(struct gpio_chip *chip, unsigned offset) ...@@ -88,7 +88,7 @@ static int rb532_gpio_get(struct gpio_chip *chip, unsigned offset)
{ {
struct rb532_gpio_chip *gpch; struct rb532_gpio_chip *gpch;
gpch = container_of(chip, struct rb532_gpio_chip, chip); gpch = gpiochip_get_data(chip);
return !!rb532_get_bit(offset, gpch->regbase + GPIOD); return !!rb532_get_bit(offset, gpch->regbase + GPIOD);
} }
...@@ -100,7 +100,7 @@ static void rb532_gpio_set(struct gpio_chip *chip, ...@@ -100,7 +100,7 @@ static void rb532_gpio_set(struct gpio_chip *chip,
{ {
struct rb532_gpio_chip *gpch; struct rb532_gpio_chip *gpch;
gpch = container_of(chip, struct rb532_gpio_chip, chip); gpch = gpiochip_get_data(chip);
rb532_set_bit(value, offset, gpch->regbase + GPIOD); rb532_set_bit(value, offset, gpch->regbase + GPIOD);
} }
...@@ -111,7 +111,7 @@ static int rb532_gpio_direction_input(struct gpio_chip *chip, unsigned offset) ...@@ -111,7 +111,7 @@ static int rb532_gpio_direction_input(struct gpio_chip *chip, unsigned offset)
{ {
struct rb532_gpio_chip *gpch; struct rb532_gpio_chip *gpch;
gpch = container_of(chip, struct rb532_gpio_chip, chip); gpch = gpiochip_get_data(chip);
/* disable alternate function in case it's set */ /* disable alternate function in case it's set */
rb532_set_bit(0, offset, gpch->regbase + GPIOFUNC); rb532_set_bit(0, offset, gpch->regbase + GPIOFUNC);
...@@ -128,7 +128,7 @@ static int rb532_gpio_direction_output(struct gpio_chip *chip, ...@@ -128,7 +128,7 @@ static int rb532_gpio_direction_output(struct gpio_chip *chip,
{ {
struct rb532_gpio_chip *gpch; struct rb532_gpio_chip *gpch;
gpch = container_of(chip, struct rb532_gpio_chip, chip); gpch = gpiochip_get_data(chip);
/* disable alternate function in case it's set */ /* disable alternate function in case it's set */
rb532_set_bit(0, offset, gpch->regbase + GPIOFUNC); rb532_set_bit(0, offset, gpch->regbase + GPIOFUNC);
...@@ -200,7 +200,7 @@ int __init rb532_gpio_init(void) ...@@ -200,7 +200,7 @@ int __init rb532_gpio_init(void)
} }
/* Register our GPIO chip */ /* Register our GPIO chip */
gpiochip_add(&rb532_gpio_chip->chip); gpiochip_add_data(&rb532_gpio_chip->chip, rb532_gpio_chip);
return 0; return 0;
} }
......
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