Commit a772a26d authored by Linus Walleij's avatar Linus Walleij

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: default avatarMathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent 709d71a1
...@@ -179,7 +179,7 @@ static int msic_irq_type(struct irq_data *data, unsigned type) ...@@ -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) 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; return mg->irq_base + offset;
} }
...@@ -297,7 +297,7 @@ static int platform_msic_gpio_probe(struct platform_device *pdev) ...@@ -297,7 +297,7 @@ static int platform_msic_gpio_probe(struct platform_device *pdev)
mutex_init(&mg->buslock); mutex_init(&mg->buslock);
retval = gpiochip_add(&mg->chip); retval = gpiochip_add_data(&mg->chip, mg);
if (retval) { if (retval) {
dev_err(dev, "Adding MSIC gpio chip failed\n"); dev_err(dev, "Adding MSIC gpio chip failed\n");
goto err; goto err;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment