[PATCH] soc: fsl/qe: fix gpio save_regs functions

Subsystems: freescale quicc engine library, freescale soc drivers, the rest

STALE3618d

2 messages, 2 authors, 2016-09-07 · open the first message on its own page

[PATCH] soc: fsl/qe: fix gpio save_regs functions

From: Christophe Leroy <hidden>
Date: 2016-09-05 22:52:27

of_mm_gpiochip_add_data() calls mm_gc->save_regs() before
setting the data. Therefore ->save_regs() cannot use
gpiochip_get_data()

An Oops is encountered without this fix.

fixes: 1e714e54b5ca5 ("powerpc: qe_lib-gpio: use gpiochip data pointer")
Signed-off-by: Christophe Leroy <redacted>
Cc: <redacted>
---
 drivers/soc/fsl/qe/gpio.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/soc/fsl/qe/gpio.c b/drivers/soc/fsl/qe/gpio.c
index 333eb22..0aaf429 100644
--- a/drivers/soc/fsl/qe/gpio.c
+++ b/drivers/soc/fsl/qe/gpio.c
@@ -41,7 +41,8 @@ struct qe_gpio_chip {
 
 static void qe_gpio_save_regs(struct of_mm_gpio_chip *mm_gc)
 {
-	struct qe_gpio_chip *qe_gc = gpiochip_get_data(&mm_gc->gc);
+	struct qe_gpio_chip *qe_gc =
+		container_of(mm_gc, struct qe_gpio_chip, mm_gc);
 	struct qe_pio_regs __iomem *regs = mm_gc->regs;
 
 	qe_gc->cpdata = in_be32(&regs->cpdata);
-- 
2.1.0

Re: [PATCH] soc: fsl/qe: fix gpio save_regs functions

From: Linus Walleij <hidden>
Date: 2016-09-07 22:05:53

On Tue, Sep 6, 2016 at 12:52 AM, Christophe Leroy
[off-list ref] wrote:
of_mm_gpiochip_add_data() calls mm_gc->save_regs() before
setting the data. Therefore ->save_regs() cannot use
gpiochip_get_data()

An Oops is encountered without this fix.

fixes: 1e714e54b5ca5 ("powerpc: qe_lib-gpio: use gpiochip data pointer")
Signed-off-by: Christophe Leroy <redacted>
Cc: <redacted>
Aha sorry for my regular screwups. :(
Reviewed-by: Linus Walleij <redacted>

Yours,
Linus Walleij
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help