diff options
author | Linus Walleij <linus.walleij@linaro.org> | 2015-12-08 16:40:43 -0500 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2016-01-05 08:15:03 -0500 |
commit | 88057d6e4a2a9c221bf81cfd18f25d0ff956af9e (patch) | |
tree | e00e12755fa5fdf59f48cf5d777a821643be3586 /drivers/pinctrl/sunxi | |
parent | 9f57f81c129f0f9456f78f00235f70ac5e21e0f5 (diff) |
pinctrl: sunxi: 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: Chen-Yu Tsai <wens@csie.org>
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/pinctrl/sunxi')
-rw-r--r-- | drivers/pinctrl/sunxi/pinctrl-sunxi.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/pinctrl/sunxi/pinctrl-sunxi.c b/drivers/pinctrl/sunxi/pinctrl-sunxi.c index c53a2dbdb5cf..7a2465f5e71e 100644 --- a/drivers/pinctrl/sunxi/pinctrl-sunxi.c +++ b/drivers/pinctrl/sunxi/pinctrl-sunxi.c | |||
@@ -12,7 +12,7 @@ | |||
12 | 12 | ||
13 | #include <linux/io.h> | 13 | #include <linux/io.h> |
14 | #include <linux/clk.h> | 14 | #include <linux/clk.h> |
15 | #include <linux/gpio.h> | 15 | #include <linux/gpio/driver.h> |
16 | #include <linux/irqdomain.h> | 16 | #include <linux/irqdomain.h> |
17 | #include <linux/irqchip/chained_irq.h> | 17 | #include <linux/irqchip/chained_irq.h> |
18 | #include <linux/module.h> | 18 | #include <linux/module.h> |
@@ -454,7 +454,7 @@ static int sunxi_pinctrl_gpio_direction_input(struct gpio_chip *chip, | |||
454 | 454 | ||
455 | static int sunxi_pinctrl_gpio_get(struct gpio_chip *chip, unsigned offset) | 455 | static int sunxi_pinctrl_gpio_get(struct gpio_chip *chip, unsigned offset) |
456 | { | 456 | { |
457 | struct sunxi_pinctrl *pctl = dev_get_drvdata(chip->parent); | 457 | struct sunxi_pinctrl *pctl = gpiochip_get_data(chip); |
458 | u32 reg = sunxi_data_reg(offset); | 458 | u32 reg = sunxi_data_reg(offset); |
459 | u8 index = sunxi_data_offset(offset); | 459 | u8 index = sunxi_data_offset(offset); |
460 | u32 set_mux = pctl->desc->irq_read_needs_mux && | 460 | u32 set_mux = pctl->desc->irq_read_needs_mux && |
@@ -475,7 +475,7 @@ static int sunxi_pinctrl_gpio_get(struct gpio_chip *chip, unsigned offset) | |||
475 | static void sunxi_pinctrl_gpio_set(struct gpio_chip *chip, | 475 | static void sunxi_pinctrl_gpio_set(struct gpio_chip *chip, |
476 | unsigned offset, int value) | 476 | unsigned offset, int value) |
477 | { | 477 | { |
478 | struct sunxi_pinctrl *pctl = dev_get_drvdata(chip->parent); | 478 | struct sunxi_pinctrl *pctl = gpiochip_get_data(chip); |
479 | u32 reg = sunxi_data_reg(offset); | 479 | u32 reg = sunxi_data_reg(offset); |
480 | u8 index = sunxi_data_offset(offset); | 480 | u8 index = sunxi_data_offset(offset); |
481 | unsigned long flags; | 481 | unsigned long flags; |
@@ -522,7 +522,7 @@ static int sunxi_pinctrl_gpio_of_xlate(struct gpio_chip *gc, | |||
522 | 522 | ||
523 | static int sunxi_pinctrl_gpio_to_irq(struct gpio_chip *chip, unsigned offset) | 523 | static int sunxi_pinctrl_gpio_to_irq(struct gpio_chip *chip, unsigned offset) |
524 | { | 524 | { |
525 | struct sunxi_pinctrl *pctl = dev_get_drvdata(chip->parent); | 525 | struct sunxi_pinctrl *pctl = gpiochip_get_data(chip); |
526 | struct sunxi_desc_function *desc; | 526 | struct sunxi_desc_function *desc; |
527 | unsigned pinnum = pctl->desc->pin_base + offset; | 527 | unsigned pinnum = pctl->desc->pin_base + offset; |
528 | unsigned irqnum; | 528 | unsigned irqnum; |
@@ -962,7 +962,7 @@ int sunxi_pinctrl_init(struct platform_device *pdev, | |||
962 | pctl->chip->parent = &pdev->dev; | 962 | pctl->chip->parent = &pdev->dev; |
963 | pctl->chip->base = pctl->desc->pin_base; | 963 | pctl->chip->base = pctl->desc->pin_base; |
964 | 964 | ||
965 | ret = gpiochip_add(pctl->chip); | 965 | ret = gpiochip_add_data(pctl->chip, pctl); |
966 | if (ret) | 966 | if (ret) |
967 | goto pinctrl_error; | 967 | goto pinctrl_error; |
968 | 968 | ||