diff options
author | Linus Walleij <linus.walleij@linaro.org> | 2016-03-30 04:48:01 -0400 |
---|---|---|
committer | Lee Jones <lee.jones@linaro.org> | 2016-04-19 02:58:06 -0400 |
commit | 082cc468385dbc7bbdc234bf6f2577e64fc00bbb (patch) | |
tree | ed2245ddf87347700ebb33f92a348c1459e0e670 /drivers/mfd | |
parent | cbdd535d9481025a5a9020f9e9875b68ad86111c (diff) |
mfd: asic3: 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: Paul Parsons <lost.distance@yahoo.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Diffstat (limited to 'drivers/mfd')
-rw-r--r-- | drivers/mfd/asic3.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/mfd/asic3.c b/drivers/mfd/asic3.c index 4dca6bc61f5b..0413c8159551 100644 --- a/drivers/mfd/asic3.c +++ b/drivers/mfd/asic3.c | |||
@@ -446,7 +446,7 @@ static int asic3_gpio_direction(struct gpio_chip *chip, | |||
446 | unsigned long flags; | 446 | unsigned long flags; |
447 | struct asic3 *asic; | 447 | struct asic3 *asic; |
448 | 448 | ||
449 | asic = container_of(chip, struct asic3, gpio); | 449 | asic = gpiochip_get_data(chip); |
450 | gpio_base = ASIC3_GPIO_TO_BASE(offset); | 450 | gpio_base = ASIC3_GPIO_TO_BASE(offset); |
451 | 451 | ||
452 | if (gpio_base > ASIC3_GPIO_D_BASE) { | 452 | if (gpio_base > ASIC3_GPIO_D_BASE) { |
@@ -492,7 +492,7 @@ static int asic3_gpio_get(struct gpio_chip *chip, | |||
492 | u32 mask = ASIC3_GPIO_TO_MASK(offset); | 492 | u32 mask = ASIC3_GPIO_TO_MASK(offset); |
493 | struct asic3 *asic; | 493 | struct asic3 *asic; |
494 | 494 | ||
495 | asic = container_of(chip, struct asic3, gpio); | 495 | asic = gpiochip_get_data(chip); |
496 | gpio_base = ASIC3_GPIO_TO_BASE(offset); | 496 | gpio_base = ASIC3_GPIO_TO_BASE(offset); |
497 | 497 | ||
498 | if (gpio_base > ASIC3_GPIO_D_BASE) { | 498 | if (gpio_base > ASIC3_GPIO_D_BASE) { |
@@ -513,7 +513,7 @@ static void asic3_gpio_set(struct gpio_chip *chip, | |||
513 | unsigned long flags; | 513 | unsigned long flags; |
514 | struct asic3 *asic; | 514 | struct asic3 *asic; |
515 | 515 | ||
516 | asic = container_of(chip, struct asic3, gpio); | 516 | asic = gpiochip_get_data(chip); |
517 | gpio_base = ASIC3_GPIO_TO_BASE(offset); | 517 | gpio_base = ASIC3_GPIO_TO_BASE(offset); |
518 | 518 | ||
519 | if (gpio_base > ASIC3_GPIO_D_BASE) { | 519 | if (gpio_base > ASIC3_GPIO_D_BASE) { |
@@ -540,7 +540,7 @@ static void asic3_gpio_set(struct gpio_chip *chip, | |||
540 | 540 | ||
541 | static int asic3_gpio_to_irq(struct gpio_chip *chip, unsigned offset) | 541 | static int asic3_gpio_to_irq(struct gpio_chip *chip, unsigned offset) |
542 | { | 542 | { |
543 | struct asic3 *asic = container_of(chip, struct asic3, gpio); | 543 | struct asic3 *asic = gpiochip_get_data(chip); |
544 | 544 | ||
545 | return asic->irq_base + offset; | 545 | return asic->irq_base + offset; |
546 | } | 546 | } |
@@ -595,7 +595,7 @@ static __init int asic3_gpio_probe(struct platform_device *pdev, | |||
595 | alt_reg[i]); | 595 | alt_reg[i]); |
596 | } | 596 | } |
597 | 597 | ||
598 | return gpiochip_add(&asic->gpio); | 598 | return gpiochip_add_data(&asic->gpio, asic); |
599 | } | 599 | } |
600 | 600 | ||
601 | static int asic3_gpio_remove(struct platform_device *pdev) | 601 | static int asic3_gpio_remove(struct platform_device *pdev) |