Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Linus Walleij and committed by
Lee Jones
082cc468 cbdd535d

+5 -5
+5 -5
drivers/mfd/asic3.c
··· 446 446 unsigned long flags; 447 447 struct asic3 *asic; 448 448 449 - asic = container_of(chip, struct asic3, gpio); 449 + asic = gpiochip_get_data(chip); 450 450 gpio_base = ASIC3_GPIO_TO_BASE(offset); 451 451 452 452 if (gpio_base > ASIC3_GPIO_D_BASE) { ··· 492 492 u32 mask = ASIC3_GPIO_TO_MASK(offset); 493 493 struct asic3 *asic; 494 494 495 - asic = container_of(chip, struct asic3, gpio); 495 + asic = gpiochip_get_data(chip); 496 496 gpio_base = ASIC3_GPIO_TO_BASE(offset); 497 497 498 498 if (gpio_base > ASIC3_GPIO_D_BASE) { ··· 513 513 unsigned long flags; 514 514 struct asic3 *asic; 515 515 516 - asic = container_of(chip, struct asic3, gpio); 516 + asic = gpiochip_get_data(chip); 517 517 gpio_base = ASIC3_GPIO_TO_BASE(offset); 518 518 519 519 if (gpio_base > ASIC3_GPIO_D_BASE) { ··· 540 540 541 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 545 return asic->irq_base + offset; 546 546 } ··· 595 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 601 static int asic3_gpio_remove(struct platform_device *pdev)