diff options
author | Linus Walleij <linus.walleij@linaro.org> | 2015-12-08 16:50:08 -0500 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2016-01-05 08:15:08 -0500 |
commit | 5c809c63ab508423225f5aea00f82308a427b0f9 (patch) | |
tree | b00af50def34f345ba8e7220d03da9de818c2ec7 | |
parent | dbf09b0aa9e75222dda7aa4f2fcd3eca107cf450 (diff) |
pinctrl: vt8500-wmt: 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: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
-rw-r--r-- | drivers/pinctrl/vt8500/pinctrl-wmt.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/pinctrl/vt8500/pinctrl-wmt.c b/drivers/pinctrl/vt8500/pinctrl-wmt.c index e9c1dfd90570..5c261bf5542f 100644 --- a/drivers/pinctrl/vt8500/pinctrl-wmt.c +++ b/drivers/pinctrl/vt8500/pinctrl-wmt.c | |||
@@ -14,7 +14,7 @@ | |||
14 | */ | 14 | */ |
15 | 15 | ||
16 | #include <linux/err.h> | 16 | #include <linux/err.h> |
17 | #include <linux/gpio.h> | 17 | #include <linux/gpio/driver.h> |
18 | #include <linux/interrupt.h> | 18 | #include <linux/interrupt.h> |
19 | #include <linux/io.h> | 19 | #include <linux/io.h> |
20 | #include <linux/irq.h> | 20 | #include <linux/irq.h> |
@@ -488,7 +488,7 @@ static struct pinctrl_desc wmt_desc = { | |||
488 | 488 | ||
489 | static int wmt_gpio_get_direction(struct gpio_chip *chip, unsigned offset) | 489 | static int wmt_gpio_get_direction(struct gpio_chip *chip, unsigned offset) |
490 | { | 490 | { |
491 | struct wmt_pinctrl_data *data = dev_get_drvdata(chip->parent); | 491 | struct wmt_pinctrl_data *data = gpiochip_get_data(chip); |
492 | u32 bank = WMT_BANK_FROM_PIN(offset); | 492 | u32 bank = WMT_BANK_FROM_PIN(offset); |
493 | u32 bit = WMT_BIT_FROM_PIN(offset); | 493 | u32 bit = WMT_BIT_FROM_PIN(offset); |
494 | u32 reg_dir = data->banks[bank].reg_dir; | 494 | u32 reg_dir = data->banks[bank].reg_dir; |
@@ -503,7 +503,7 @@ static int wmt_gpio_get_direction(struct gpio_chip *chip, unsigned offset) | |||
503 | 503 | ||
504 | static int wmt_gpio_get_value(struct gpio_chip *chip, unsigned offset) | 504 | static int wmt_gpio_get_value(struct gpio_chip *chip, unsigned offset) |
505 | { | 505 | { |
506 | struct wmt_pinctrl_data *data = dev_get_drvdata(chip->parent); | 506 | struct wmt_pinctrl_data *data = gpiochip_get_data(chip); |
507 | u32 bank = WMT_BANK_FROM_PIN(offset); | 507 | u32 bank = WMT_BANK_FROM_PIN(offset); |
508 | u32 bit = WMT_BIT_FROM_PIN(offset); | 508 | u32 bit = WMT_BIT_FROM_PIN(offset); |
509 | u32 reg_data_in = data->banks[bank].reg_data_in; | 509 | u32 reg_data_in = data->banks[bank].reg_data_in; |
@@ -519,7 +519,7 @@ static int wmt_gpio_get_value(struct gpio_chip *chip, unsigned offset) | |||
519 | static void wmt_gpio_set_value(struct gpio_chip *chip, unsigned offset, | 519 | static void wmt_gpio_set_value(struct gpio_chip *chip, unsigned offset, |
520 | int val) | 520 | int val) |
521 | { | 521 | { |
522 | struct wmt_pinctrl_data *data = dev_get_drvdata(chip->parent); | 522 | struct wmt_pinctrl_data *data = gpiochip_get_data(chip); |
523 | u32 bank = WMT_BANK_FROM_PIN(offset); | 523 | u32 bank = WMT_BANK_FROM_PIN(offset); |
524 | u32 bit = WMT_BIT_FROM_PIN(offset); | 524 | u32 bit = WMT_BIT_FROM_PIN(offset); |
525 | u32 reg_data_out = data->banks[bank].reg_data_out; | 525 | u32 reg_data_out = data->banks[bank].reg_data_out; |
@@ -589,7 +589,7 @@ int wmt_pinctrl_probe(struct platform_device *pdev, | |||
589 | return PTR_ERR(data->pctl_dev); | 589 | return PTR_ERR(data->pctl_dev); |
590 | } | 590 | } |
591 | 591 | ||
592 | err = gpiochip_add(&data->gpio_chip); | 592 | err = gpiochip_add_data(&data->gpio_chip, data); |
593 | if (err) { | 593 | if (err) { |
594 | dev_err(&pdev->dev, "could not add GPIO chip\n"); | 594 | dev_err(&pdev->dev, "could not add GPIO chip\n"); |
595 | goto fail_gpio; | 595 | goto fail_gpio; |