Commit 9355879e authored by Linus Walleij's avatar Linus Walleij

gpio: vx855: 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 2a873c8d
...@@ -96,7 +96,7 @@ static inline u_int32_t gpio_o_bit(int i) ...@@ -96,7 +96,7 @@ static inline u_int32_t gpio_o_bit(int i)
static int vx855gpio_direction_input(struct gpio_chip *gpio, static int vx855gpio_direction_input(struct gpio_chip *gpio,
unsigned int nr) unsigned int nr)
{ {
struct vx855_gpio *vg = container_of(gpio, struct vx855_gpio, gpio); struct vx855_gpio *vg = gpiochip_get_data(gpio);
unsigned long flags; unsigned long flags;
u_int32_t reg_out; u_int32_t reg_out;
...@@ -120,7 +120,7 @@ static int vx855gpio_direction_input(struct gpio_chip *gpio, ...@@ -120,7 +120,7 @@ static int vx855gpio_direction_input(struct gpio_chip *gpio,
static int vx855gpio_get(struct gpio_chip *gpio, unsigned int nr) static int vx855gpio_get(struct gpio_chip *gpio, unsigned int nr)
{ {
struct vx855_gpio *vg = container_of(gpio, struct vx855_gpio, gpio); struct vx855_gpio *vg = gpiochip_get_data(gpio);
u_int32_t reg_in; u_int32_t reg_in;
int ret = 0; int ret = 0;
...@@ -146,7 +146,7 @@ static int vx855gpio_get(struct gpio_chip *gpio, unsigned int nr) ...@@ -146,7 +146,7 @@ static int vx855gpio_get(struct gpio_chip *gpio, unsigned int nr)
static void vx855gpio_set(struct gpio_chip *gpio, unsigned int nr, static void vx855gpio_set(struct gpio_chip *gpio, unsigned int nr,
int val) int val)
{ {
struct vx855_gpio *vg = container_of(gpio, struct vx855_gpio, gpio); struct vx855_gpio *vg = gpiochip_get_data(gpio);
unsigned long flags; unsigned long flags;
u_int32_t reg_out; u_int32_t reg_out;
...@@ -259,7 +259,7 @@ static int vx855gpio_probe(struct platform_device *pdev) ...@@ -259,7 +259,7 @@ static int vx855gpio_probe(struct platform_device *pdev)
vx855gpio_gpio_setup(vg); vx855gpio_gpio_setup(vg);
return gpiochip_add(&vg->gpio); return gpiochip_add_data(&vg->gpio, vg);
} }
static int vx855gpio_remove(struct platform_device *pdev) static int vx855gpio_remove(struct platform_device *pdev)
......
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