summaryrefslogtreecommitdiffstats
path: root/drivers/gpio
diff options
context:
space:
mode:
authorGuenter Roeck <linux@roeck-us.net>2016-01-07 01:20:10 +0100
committerLinus Walleij <linus.walleij@linaro.org>2016-01-07 10:06:56 +0100
commitde06c1db255fb70301651a0255c6147e0036ea01 (patch)
treef0c7b88d678de37768a83c37f865c8eaec849136 /drivers/gpio
parentleds: pca9532: use gpiochip data pointer (diff)
downloadlinux-de06c1db255fb70301651a0255c6147e0036ea01.tar.xz
linux-de06c1db255fb70301651a0255c6147e0036ea01.zip
gpio: xilinx: Do not use gpiochip_get_data() in xgpio_save_regs()
Commit 097d88e94c44 ("gpio: xilinx: use gpiochip data pointer") replaces the use of container_of() with gpiochip_get_data(). Unfortunately, the data pointer is not yet set by the time xgpio_save_regs() is called, causing a system hang. Fixes: 097d88e94c44 ("gpio: xilinx: use gpiochip data pointer") Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/gpio')
-rw-r--r--drivers/gpio/gpio-xilinx.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/gpio/gpio-xilinx.c b/drivers/gpio/gpio-xilinx.c
index 3345ab0ba1b3..d0fbb7f99523 100644
--- a/drivers/gpio/gpio-xilinx.c
+++ b/drivers/gpio/gpio-xilinx.c
@@ -207,7 +207,8 @@ static int xgpio_dir_out(struct gpio_chip *gc, unsigned int gpio, int val)
*/
static void xgpio_save_regs(struct of_mm_gpio_chip *mm_gc)
{
- struct xgpio_instance *chip = gpiochip_get_data(&mm_gc->gc);
+ struct xgpio_instance *chip =
+ container_of(mm_gc, struct xgpio_instance, mmchip);
xgpio_writereg(mm_gc->regs + XGPIO_DATA_OFFSET, chip->gpio_state[0]);
xgpio_writereg(mm_gc->regs + XGPIO_TRI_OFFSET, chip->gpio_dir[0]);