Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1303719 > unrolled thread

[PATCH -next] gpio: mm-lantiq: Do not use gpiochip_get_data() in ltq_mm_save_regs()

Started byGuenter Roeck <linux@roeck-us.net>
First post2016-01-07 17:30 +0100
Last post2016-01-13 10:30 +0100
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH -next] gpio: mm-lantiq: Do not use gpiochip_get_data() in ltq_mm_save_regs() Guenter Roeck <linux@roeck-us.net> - 2016-01-07 17:30 +0100
    Re: [PATCH -next] gpio: mm-lantiq: Do not use gpiochip_get_data() in ltq_mm_save_regs() Linus Walleij <linus.walleij@linaro.org> - 2016-01-13 10:30 +0100

#1303719 — [PATCH -next] gpio: mm-lantiq: Do not use gpiochip_get_data() in ltq_mm_save_regs()

FromGuenter Roeck <linux@roeck-us.net>
Date2016-01-07 17:30 +0100
Subject[PATCH -next] gpio: mm-lantiq: Do not use gpiochip_get_data() in ltq_mm_save_regs()
Message-ID<qOlBM-29Y-19@gated-at.bofh.it>
Commit 6aa7dbfa2877 ("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: 6aa7dbfa2877 ("gpio: mm-lantiq: use gpiochip data pointer")
Cc: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Cc: John Crispin <blogic@openwrt.org>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
---
It might make sense to merge this patch into the patch causing the problem.

 drivers/gpio/gpio-mm-lantiq.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpio/gpio-mm-lantiq.c b/drivers/gpio/gpio-mm-lantiq.c
index a2071ed69f79..54e5d8257d34 100644
--- a/drivers/gpio/gpio-mm-lantiq.c
+++ b/drivers/gpio/gpio-mm-lantiq.c
@@ -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)
 {
-	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 */
 	ltq_ebu_w32(CPHYSADDR(chip->mmchip.regs) | 0x1, LTQ_EBU_ADDRSEL1);
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1308202

FromLinus Walleij <linus.walleij@linaro.org>
Date2016-01-13 10:30 +0100
Message-ID<qQpUD-63W-15@gated-at.bofh.it>
In reply to#1303719
On Thu, Jan 7, 2016 at 5:24 PM, Guenter Roeck <linux@roeck-us.net> wrote:

> Commit 6aa7dbfa2877 ("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: 6aa7dbfa2877 ("gpio: mm-lantiq: use gpiochip data pointer")
> Cc: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
> Cc: John Crispin <blogic@openwrt.org>
> Signed-off-by: Guenter Roeck <linux@roeck-us.net>

Patch applied.

> It might make sense to merge this patch into the patch causing the problem.

Nah, don't wanna rebase. Plus people should see all mistakes I make...

Yours,
Linus Walleij

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web