diff options
| author | Linus Walleij <linus.walleij@linaro.org> | 2015-12-08 16:01:00 -0500 |
|---|---|---|
| committer | Linus Walleij <linus.walleij@linaro.org> | 2016-01-05 08:14:48 -0500 |
| commit | e19a5f795c1c5be562cfee1c578c97890a755abc (patch) | |
| tree | a7ac065a00102959d5c0424c6ad04ef28b76e547 /drivers/pinctrl/bcm | |
| parent | bf9a5c96c87cf113e8e56df183a5f7c9af4a4c89 (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.c | 10 |
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 | ||
| 338 | static int bcm2835_gpio_get(struct gpio_chip *chip, unsigned offset) | 338 | static 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 | ||
| 345 | static void bcm2835_gpio_set(struct gpio_chip *chip, unsigned offset, int value) | 345 | static 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 | ||
| 359 | static int bcm2835_gpio_to_irq(struct gpio_chip *chip, unsigned offset) | 359 | static 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; |
