Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1303720 > unrolled thread
| Started by | Guenter Roeck <linux@roeck-us.net> |
|---|---|
| First post | 2016-01-07 17:30 +0100 |
| Last post | 2016-01-13 10:30 +0100 |
| Articles | 2 — 2 participants |
Back to article view | Back to linux.kernel
[PATCH -next] gpio: mpc8xxx: Do not use gpiochip_get_data() in mpc8xxx_gpio_save_regs() Guenter Roeck <linux@roeck-us.net> - 2016-01-07 17:30 +0100
Re: [PATCH -next] gpio: mpc8xxx: Do not use gpiochip_get_data() in mpc8xxx_gpio_save_regs() Linus Walleij <linus.walleij@linaro.org> - 2016-01-13 10:30 +0100
| From | Guenter Roeck <linux@roeck-us.net> |
|---|---|
| Date | 2016-01-07 17:30 +0100 |
| Subject | [PATCH -next] gpio: mpc8xxx: Do not use gpiochip_get_data() in mpc8xxx_gpio_save_regs() |
| Message-ID | <qOlBM-29Y-21@gated-at.bofh.it> |
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 <u.kleine-koenig@pengutronix.de>
Cc: Alexander Stein <alexander.stein@systec-electronic.com>
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-mpc8xxx.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/gpio/gpio-mpc8xxx.c b/drivers/gpio/gpio-mpc8xxx.c
index 21eff0e1df87..9d40787e66c0 100644
--- a/drivers/gpio/gpio-mpc8xxx.c
+++ b/drivers/gpio/gpio-mpc8xxx.c
@@ -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);
}
--
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]
| From | Linus Walleij <linus.walleij@linaro.org> |
|---|---|
| Date | 2016-01-13 10:30 +0100 |
| Message-ID | <qQpUD-63W-13@gated-at.bofh.it> |
| In reply to | #1303720 |
On Thu, Jan 7, 2016 at 5:25 PM, Guenter Roeck <linux@roeck-us.net> wrote:
> 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 <u.kleine-koenig@pengutronix.de>
> Cc: Alexander Stein <alexander.stein@systec-electronic.com>
> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Patch applied.
Yours,
Linus Walleij
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web