aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpio/gpio-vx855.c
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2015-12-07 09:09:57 -0500
committerLinus Walleij <linus.walleij@linaro.org>2016-01-05 05:21:18 -0500
commit9355879ea42b84914ab27064df6760b2a7db0883 (patch)
tree18bcd8f956efc0892c870c69ddb72b9971ea15e4 /drivers/gpio/gpio-vx855.c
parent2a873c8d623023ecfde33542729bfb682fcd0f12 (diff)
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: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/gpio/gpio-vx855.c')
-rw-r--r--drivers/gpio/gpio-vx855.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/gpio/gpio-vx855.c b/drivers/gpio/gpio-vx855.c
index 57b470d5b39e..764999cc0794 100644
--- a/drivers/gpio/gpio-vx855.c
+++ b/drivers/gpio/gpio-vx855.c
@@ -96,7 +96,7 @@ static inline u_int32_t gpio_o_bit(int i)
96static int vx855gpio_direction_input(struct gpio_chip *gpio, 96static int vx855gpio_direction_input(struct gpio_chip *gpio,
97 unsigned int nr) 97 unsigned int nr)
98{ 98{
99 struct vx855_gpio *vg = container_of(gpio, struct vx855_gpio, gpio); 99 struct vx855_gpio *vg = gpiochip_get_data(gpio);
100 unsigned long flags; 100 unsigned long flags;
101 u_int32_t reg_out; 101 u_int32_t reg_out;
102 102
@@ -120,7 +120,7 @@ static int vx855gpio_direction_input(struct gpio_chip *gpio,
120 120
121static int vx855gpio_get(struct gpio_chip *gpio, unsigned int nr) 121static int vx855gpio_get(struct gpio_chip *gpio, unsigned int nr)
122{ 122{
123 struct vx855_gpio *vg = container_of(gpio, struct vx855_gpio, gpio); 123 struct vx855_gpio *vg = gpiochip_get_data(gpio);
124 u_int32_t reg_in; 124 u_int32_t reg_in;
125 int ret = 0; 125 int ret = 0;
126 126
@@ -146,7 +146,7 @@ static int vx855gpio_get(struct gpio_chip *gpio, unsigned int nr)
146static void vx855gpio_set(struct gpio_chip *gpio, unsigned int nr, 146static void vx855gpio_set(struct gpio_chip *gpio, unsigned int nr,
147 int val) 147 int val)
148{ 148{
149 struct vx855_gpio *vg = container_of(gpio, struct vx855_gpio, gpio); 149 struct vx855_gpio *vg = gpiochip_get_data(gpio);
150 unsigned long flags; 150 unsigned long flags;
151 u_int32_t reg_out; 151 u_int32_t reg_out;
152 152
@@ -259,7 +259,7 @@ static int vx855gpio_probe(struct platform_device *pdev)
259 259
260 vx855gpio_gpio_setup(vg); 260 vx855gpio_gpio_setup(vg);
261 261
262 return gpiochip_add(&vg->gpio); 262 return gpiochip_add_data(&vg->gpio, vg);
263} 263}
264 264
265static int vx855gpio_remove(struct platform_device *pdev) 265static int vx855gpio_remove(struct platform_device *pdev)