]> git.karo-electronics.de Git - linux-beck.git/commitdiff
soc/fsl/qe: fix gpio save_regs functions
authorChristophe Leroy <christophe.leroy@c-s.fr>
Mon, 5 Sep 2016 22:52:16 +0000 (00:52 +0200)
committerScott Wood <oss@buserror.net>
Sun, 25 Sep 2016 07:38:56 +0000 (02:38 -0500)
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 <christophe.leroy@c-s.fr>
Cc: <stable@vger.kernel.org>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Scott Wood <oss@buserror.net>
drivers/soc/fsl/qe/gpio.c

index 333eb2215a5795c65d505b4ae81a3f09b511a3c2..0aaf429f31d571f569fe0916b52d10cf3dadfd49 100644 (file)
@@ -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);