karo: tx53: check 'video_mode' variable before calling karo_fdt_get_backlight_polarity()
authorLothar Waßmann <LW@KARO-electronics.de>
Mon, 15 Jun 2015 08:02:57 +0000 (10:02 +0200)
committerLothar Waßmann <LW@KARO-electronics.de>
Mon, 15 Jun 2015 12:39:51 +0000 (14:39 +0200)
board/karo/tx53/tx53.c

index 3c6873b..d6107f3 100644 (file)
@@ -1059,13 +1059,14 @@ void lcd_ctrl_init(void *lcdbase)
        }
 
        karo_fdt_move_fdt();
        }
 
        karo_fdt_move_fdt();
-       lcd_bl_polarity = karo_fdt_get_backlight_polarity(working_fdt);
 
        if (video_mode == NULL) {
                debug("Disabling LCD\n");
                lcd_enabled = 0;
                return;
        }
 
        if (video_mode == NULL) {
                debug("Disabling LCD\n");
                lcd_enabled = 0;
                return;
        }
+
+       lcd_bl_polarity = karo_fdt_get_backlight_polarity(working_fdt);
        vm = video_mode;
        if (karo_fdt_get_fb_mode(working_fdt, video_mode, &fb_mode) == 0) {
                p = &fb_mode;
        vm = video_mode;
        if (karo_fdt_get_fb_mode(working_fdt, video_mode, &fb_mode) == 0) {
                p = &fb_mode;