aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pinctrl/bcm
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2015-12-08 16:01:00 -0500
committerLinus Walleij <linus.walleij@linaro.org>2016-01-05 08:14:48 -0500
commite19a5f795c1c5be562cfee1c578c97890a755abc (patch)
treea7ac065a00102959d5c0424c6ad04ef28b76e547 /drivers/pinctrl/bcm
parentbf9a5c96c87cf113e8e56df183a5f7c9af4a4c89 (diff)
pinctrl: bcm2835: 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: Stephen Warren <swarren@wwwdotorg.org> Acked-by: Eric Anholt <eric@anholt.net> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/pinctrl/bcm')
-rw-r--r--drivers/pinctrl/bcm/pinctrl-bcm2835.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/pinctrl/bcm/pinctrl-bcm2835.c b/drivers/pinctrl/bcm/pinctrl-bcm2835.c
index 595f87028b19..7c35249058f6 100644
--- a/drivers/pinctrl/bcm/pinctrl-bcm2835.c
+++ b/drivers/pinctrl/bcm/pinctrl-bcm2835.c
@@ -23,7 +23,7 @@
23#include <linux/delay.h> 23#include <linux/delay.h>
24#include <linux/device.h> 24#include <linux/device.h>
25#include <linux/err.h> 25#include <linux/err.h>
26#include <linux/gpio.h> 26#include <linux/gpio/driver.h>
27#include <linux/interrupt.h> 27#include <linux/interrupt.h>
28#include <linux/io.h> 28#include <linux/io.h>
29#include <linux/irq.h> 29#include <linux/irq.h>
@@ -337,14 +337,14 @@ static int bcm2835_gpio_direction_input(struct gpio_chip *chip, unsigned offset)
337 337
338static int bcm2835_gpio_get(struct gpio_chip *chip, unsigned offset) 338static int bcm2835_gpio_get(struct gpio_chip *chip, unsigned offset)
339{ 339{
340 struct bcm2835_pinctrl *pc = dev_get_drvdata(chip->parent); 340 struct bcm2835_pinctrl *pc = gpiochip_get_data(chip);
341 341
342 return bcm2835_gpio_get_bit(pc, GPLEV0, offset); 342 return bcm2835_gpio_get_bit(pc, GPLEV0, offset);
343} 343}
344 344
345static void bcm2835_gpio_set(struct gpio_chip *chip, unsigned offset, int value) 345static void bcm2835_gpio_set(struct gpio_chip *chip, unsigned offset, int value)
346{ 346{
347 struct bcm2835_pinctrl *pc = dev_get_drvdata(chip->parent); 347 struct bcm2835_pinctrl *pc = gpiochip_get_data(chip);
348 348
349 bcm2835_gpio_set_bit(pc, value ? GPSET0 : GPCLR0, offset); 349 bcm2835_gpio_set_bit(pc, value ? GPSET0 : GPCLR0, offset);
350} 350}
@@ -358,7 +358,7 @@ static int bcm2835_gpio_direction_output(struct gpio_chip *chip,
358 358
359static int bcm2835_gpio_to_irq(struct gpio_chip *chip, unsigned offset) 359static int bcm2835_gpio_to_irq(struct gpio_chip *chip, unsigned offset)
360{ 360{
361 struct bcm2835_pinctrl *pc = dev_get_drvdata(chip->parent); 361 struct bcm2835_pinctrl *pc = gpiochip_get_data(chip);
362 362
363 return irq_linear_revmap(pc->irq_domain, offset); 363 return irq_linear_revmap(pc->irq_domain, offset);
364} 364}
@@ -1021,7 +1021,7 @@ static int bcm2835_pinctrl_probe(struct platform_device *pdev)
1021 } 1021 }
1022 } 1022 }
1023 1023
1024 err = gpiochip_add(&pc->gpio_chip); 1024 err = gpiochip_add_data(&pc->gpio_chip, pc);
1025 if (err) { 1025 if (err) {
1026 dev_err(dev, "could not add GPIO chip\n"); 1026 dev_err(dev, "could not add GPIO chip\n");
1027 return err; 1027 return err;