soc: fsl/qe: fix gpio save_regs functions
Subsystems (4)
PATCH 1/1 soc: fsl/qe: fix gpio save_regs functions
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 <[email protected]>
Cc <[email protected]>
--- drivers/soc/fsl/qe/gpio.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/soc/fsl/qe/gpio.c +2 -1
@@ -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 (®s->cpdata);
Signature · 1 line
2.1.0
Quoted 9 lines · Christophe Leroy
of_mm_gpiochip_add_data()callsmm_gc->save_regs()before setting the data. Therefore ->save_regs() cannot usegpiochip_get_data()An Oops is encountered without this fix.
Fixes 1e714e54b5ca5 ("powerpc: qe_lib-gpio: use gpiochip data pointer")Signed-off-by Christophe Leroy <[email protected]>Cc <[email protected]>
Aha sorry for my regular screwups. :(
Reviewed-by Linus Walleij <[email protected]>
Yours,
Linus Walleij