summaryrefslogtreecommitdiff
path: root/drivers/gpio/gpio-msic.c
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2015-12-07 12:37:39 +0300
committerLinus Walleij <linus.walleij@linaro.org>2016-01-05 13:21:09 +0300
commita772a26da7cf605ed33382d7822ebfac18c6b1ef (patch)
tree4e78880923e17bc468ba03d86bfec3d93cfa8f40 /drivers/gpio/gpio-msic.c
parent709d71a17c3383eca79ce9142b8d4ddc0f8028d0 (diff)
downloadlinux-a772a26da7cf605ed33382d7822ebfac18c6b1ef.tar.xz
gpio: msic: 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(). Acked-by: Mathias Nyman <mathias.nyman@linux.intel.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/gpio/gpio-msic.c')
-rw-r--r--drivers/gpio/gpio-msic.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/gpio/gpio-msic.c b/drivers/gpio/gpio-msic.c
index 9a261acb0eed..d75649787e6c 100644
--- a/drivers/gpio/gpio-msic.c
+++ b/drivers/gpio/gpio-msic.c
@@ -179,7 +179,7 @@ static int msic_irq_type(struct irq_data *data, unsigned type)
static int msic_gpio_to_irq(struct gpio_chip *chip, unsigned offset)
{
- struct msic_gpio *mg = container_of(chip, struct msic_gpio, chip);
+ struct msic_gpio *mg = gpiochip_get_data(chip);
return mg->irq_base + offset;
}
@@ -297,7 +297,7 @@ static int platform_msic_gpio_probe(struct platform_device *pdev)
mutex_init(&mg->buslock);
- retval = gpiochip_add(&mg->chip);
+ retval = gpiochip_add_data(&mg->chip, mg);
if (retval) {
dev_err(dev, "Adding MSIC gpio chip failed\n");
goto err;