gpio: msic: use gpiochip data pointer
authorLinus Walleij <linus.walleij@linaro.org>
Mon, 7 Dec 2015 09:37:39 +0000 (10:37 +0100)
committerLinus Walleij <linus.walleij@linaro.org>
Tue, 5 Jan 2016 10:21:09 +0000 (11:21 +0100)
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>
drivers/gpio/gpio-msic.c

index 9a261acb0eed19566bcd625e4fc5a93acdda79b9..d75649787e6c4eac55c582cbc7e992804f4eee21 100644 (file)
@@ -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;
This page took 0.024821 seconds and 5 git commands to generate.