Commit 95c76170 authored by Guenter Roeck's avatar Guenter Roeck Committed by Linus Walleij

gpio: mm-lantiq: Do not use gpiochip_get_data() in ltq_mm_save_regs()

Commit 6aa7dbfa ("gpio: mm-lantiq: use gpiochip data pointer") replaces
the use of container_of() with gpiochip_get_data(). However, the data
pointer is not yet set by the time the save_regs function is called.

Fixes: 6aa7dbfa ("gpio: mm-lantiq: use gpiochip data pointer")
Cc: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Cc: John Crispin <blogic@openwrt.org>
Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent a02588a0
...@@ -91,7 +91,8 @@ static int ltq_mm_dir_out(struct gpio_chip *gc, unsigned offset, int value) ...@@ -91,7 +91,8 @@ static int ltq_mm_dir_out(struct gpio_chip *gc, unsigned offset, int value)
*/ */
static void ltq_mm_save_regs(struct of_mm_gpio_chip *mm_gc) static void ltq_mm_save_regs(struct of_mm_gpio_chip *mm_gc)
{ {
struct ltq_mm *chip = gpiochip_get_data(&mm_gc->gc); struct ltq_mm *chip =
container_of(mm_gc, struct ltq_mm, mmchip);
/* tell the ebu controller which memory address we will be using */ /* tell the ebu controller which memory address we will be using */
ltq_ebu_w32(CPHYSADDR(chip->mmchip.regs) | 0x1, LTQ_EBU_ADDRSEL1); ltq_ebu_w32(CPHYSADDR(chip->mmchip.regs) | 0x1, LTQ_EBU_ADDRSEL1);
......
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