]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
drivers:video:fbdev atmel_lcdfb.c power GPIO registration bug
authorMichael Welling <mwelling@ieee.org>
Thu, 19 Jun 2014 01:52:12 +0000 (20:52 -0500)
committerTomi Valkeinen <tomi.valkeinen@ti.com>
Mon, 23 Jun 2014 11:45:49 +0000 (14:45 +0300)
A list that was intended for storing power control GPIOs was never
initialized correctly or filled. Without these lines of added code
the kernel hangs when trying to access an uninitialized list when a
power control GPIO is registered with the device tree.

Signed-off-by: Michael Welling <mwelling@ieee.org>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
drivers/video/fbdev/atmel_lcdfb.c

index e683b6ef95940dc6e5424691abff0806c61a784f..d36e830d6fc66a3755c70214dd87a99baa94e2f9 100644 (file)
@@ -1057,6 +1057,7 @@ static int atmel_lcdfb_of_init(struct atmel_lcdfb_info *sinfo)
                goto put_display_node;
        }
 
+       INIT_LIST_HEAD(&pdata->pwr_gpios);
        ret = -ENOMEM;
        for (i = 0; i < of_gpio_named_count(display_np, "atmel,power-control-gpio"); i++) {
                gpio = of_get_named_gpio_flags(display_np, "atmel,power-control-gpio",
@@ -1082,6 +1083,7 @@ static int atmel_lcdfb_of_init(struct atmel_lcdfb_info *sinfo)
                        dev_err(dev, "set direction output gpio %d failed\n", gpio);
                        goto put_display_node;
                }
+               list_add(&og->list, &pdata->pwr_gpios);
        }
 
        if (is_gpio_power)