gpio: mpc8xxx: Do not use gpiochip_get_data() in mpc8xxx_gpio_save_regs()
PATCH 1/1 gpio: mpc8xxx: Do not use gpiochip_get_data() in mpc8xxx_gpio_save_regs()
Commit 709d71a17c33 ("gpio: mpc8xxx: 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 709d71a17c33 ("gpio: mpc8xxx: use gpiochip data pointer")
Cc Uwe Kleine-König <[email protected]>
Cc Alexander Stein <[email protected]>
Signed-off-by Guenter Roeck <[email protected]>
---
It might make sense to merge this patch into the patch causing the problem.
drivers/gpio/gpio-mpc8xxx.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpio/gpio-mpc8xxx.c +2 -1
@@ -51,7 +51,8 @@ static inline u32 mpc8xxx_gpio2mask(unsigned int gpio)static void mpc8xxx_gpio_save_regs (struct of_mm_gpio_chip *mm) { -struct mpc8xxx_gpio_chip *mpc8xxx_gc =gpiochip_get_data (&mm->gc); +struct mpc8xxx_gpio_chip *mpc8xxx_gc = + container_of(mm, struct mpc8xxx_gpio_chip, mm_gc); mpc8xxx_gc->data =in_be32 (mm->regs +GPIO_DAT ); }
Signature · 1 line
2.1.4
Quoted 8 lines · Guenter Roeck
Commit
709d71a17c33("gpio: mpc8xxx: use gpiochip data pointer") replaces the use ofcontainer_of()withgpiochip_get_data(). However, the data pointer is not yet set by the time thesave_regsfunction is called.Fixes 709d71a17c33 ("gpio: mpc8xxx: use gpiochip data pointer")Cc Uwe Kleine-König <[email protected]>Cc Alexander Stein <[email protected]>Signed-off-by Guenter Roeck <[email protected]>
Patch applied.
Yours,
Linus Walleij