diff options
author | Linus Walleij <linus.walleij@linaro.org> | 2015-12-08 16:27:19 -0500 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2016-01-05 08:15:08 -0500 |
commit | dbf09b0aa9e75222dda7aa4f2fcd3eca107cf450 (patch) | |
tree | 59373e2576340423a58e755317bf33aa49101cb9 | |
parent | 80036f88db18b98bc20f7321dbd5f9947576a2b2 (diff) |
pinctrl: exynos5440: 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: Kukjin Kim <kgene@kernel.org>
Acked-by: Tomasz Figa <tomasz.figa@gmail.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
-rw-r--r-- | drivers/pinctrl/samsung/pinctrl-exynos5440.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/pinctrl/samsung/pinctrl-exynos5440.c b/drivers/pinctrl/samsung/pinctrl-exynos5440.c index f61f9a6fa9af..00ab63abf1d9 100644 --- a/drivers/pinctrl/samsung/pinctrl-exynos5440.c +++ b/drivers/pinctrl/samsung/pinctrl-exynos5440.c | |||
@@ -15,7 +15,7 @@ | |||
15 | #include <linux/io.h> | 15 | #include <linux/io.h> |
16 | #include <linux/slab.h> | 16 | #include <linux/slab.h> |
17 | #include <linux/err.h> | 17 | #include <linux/err.h> |
18 | #include <linux/gpio.h> | 18 | #include <linux/gpio/driver.h> |
19 | #include <linux/device.h> | 19 | #include <linux/device.h> |
20 | #include <linux/pinctrl/pinctrl.h> | 20 | #include <linux/pinctrl/pinctrl.h> |
21 | #include <linux/pinctrl/pinmux.h> | 21 | #include <linux/pinctrl/pinmux.h> |
@@ -539,7 +539,7 @@ static const struct pinconf_ops exynos5440_pinconf_ops = { | |||
539 | /* gpiolib gpio_set callback function */ | 539 | /* gpiolib gpio_set callback function */ |
540 | static void exynos5440_gpio_set(struct gpio_chip *gc, unsigned offset, int value) | 540 | static void exynos5440_gpio_set(struct gpio_chip *gc, unsigned offset, int value) |
541 | { | 541 | { |
542 | struct exynos5440_pinctrl_priv_data *priv = dev_get_drvdata(gc->parent); | 542 | struct exynos5440_pinctrl_priv_data *priv = gpiochip_get_data(gc); |
543 | void __iomem *base = priv->reg_base; | 543 | void __iomem *base = priv->reg_base; |
544 | u32 data; | 544 | u32 data; |
545 | 545 | ||
@@ -553,7 +553,7 @@ static void exynos5440_gpio_set(struct gpio_chip *gc, unsigned offset, int value | |||
553 | /* gpiolib gpio_get callback function */ | 553 | /* gpiolib gpio_get callback function */ |
554 | static int exynos5440_gpio_get(struct gpio_chip *gc, unsigned offset) | 554 | static int exynos5440_gpio_get(struct gpio_chip *gc, unsigned offset) |
555 | { | 555 | { |
556 | struct exynos5440_pinctrl_priv_data *priv = dev_get_drvdata(gc->parent); | 556 | struct exynos5440_pinctrl_priv_data *priv = gpiochip_get_data(gc); |
557 | void __iomem *base = priv->reg_base; | 557 | void __iomem *base = priv->reg_base; |
558 | u32 data; | 558 | u32 data; |
559 | 559 | ||
@@ -566,7 +566,7 @@ static int exynos5440_gpio_get(struct gpio_chip *gc, unsigned offset) | |||
566 | /* gpiolib gpio_direction_input callback function */ | 566 | /* gpiolib gpio_direction_input callback function */ |
567 | static int exynos5440_gpio_direction_input(struct gpio_chip *gc, unsigned offset) | 567 | static int exynos5440_gpio_direction_input(struct gpio_chip *gc, unsigned offset) |
568 | { | 568 | { |
569 | struct exynos5440_pinctrl_priv_data *priv = dev_get_drvdata(gc->parent); | 569 | struct exynos5440_pinctrl_priv_data *priv = gpiochip_get_data(gc); |
570 | void __iomem *base = priv->reg_base; | 570 | void __iomem *base = priv->reg_base; |
571 | u32 data; | 571 | u32 data; |
572 | 572 | ||
@@ -586,7 +586,7 @@ static int exynos5440_gpio_direction_input(struct gpio_chip *gc, unsigned offset | |||
586 | static int exynos5440_gpio_direction_output(struct gpio_chip *gc, unsigned offset, | 586 | static int exynos5440_gpio_direction_output(struct gpio_chip *gc, unsigned offset, |
587 | int value) | 587 | int value) |
588 | { | 588 | { |
589 | struct exynos5440_pinctrl_priv_data *priv = dev_get_drvdata(gc->parent); | 589 | struct exynos5440_pinctrl_priv_data *priv = gpiochip_get_data(gc); |
590 | void __iomem *base = priv->reg_base; | 590 | void __iomem *base = priv->reg_base; |
591 | u32 data; | 591 | u32 data; |
592 | 592 | ||
@@ -607,7 +607,7 @@ static int exynos5440_gpio_direction_output(struct gpio_chip *gc, unsigned offse | |||
607 | /* gpiolib gpio_to_irq callback function */ | 607 | /* gpiolib gpio_to_irq callback function */ |
608 | static int exynos5440_gpio_to_irq(struct gpio_chip *gc, unsigned offset) | 608 | static int exynos5440_gpio_to_irq(struct gpio_chip *gc, unsigned offset) |
609 | { | 609 | { |
610 | struct exynos5440_pinctrl_priv_data *priv = dev_get_drvdata(gc->parent); | 610 | struct exynos5440_pinctrl_priv_data *priv = gpiochip_get_data(gc); |
611 | unsigned int virq; | 611 | unsigned int virq; |
612 | 612 | ||
613 | if (offset < 16 || offset > 23) | 613 | if (offset < 16 || offset > 23) |
@@ -825,7 +825,7 @@ static int exynos5440_gpiolib_register(struct platform_device *pdev, | |||
825 | gc->to_irq = exynos5440_gpio_to_irq; | 825 | gc->to_irq = exynos5440_gpio_to_irq; |
826 | gc->label = "gpiolib-exynos5440"; | 826 | gc->label = "gpiolib-exynos5440"; |
827 | gc->owner = THIS_MODULE; | 827 | gc->owner = THIS_MODULE; |
828 | ret = gpiochip_add(gc); | 828 | ret = gpiochip_add_data(gc, priv); |
829 | if (ret) { | 829 | if (ret) { |
830 | dev_err(&pdev->dev, "failed to register gpio_chip %s, error " | 830 | dev_err(&pdev->dev, "failed to register gpio_chip %s, error " |
831 | "code: %d\n", gc->label, ret); | 831 | "code: %d\n", gc->label, ret); |