omapfb: suspend/resume only if FB device is already initialized
authorJouni Hogander <jouni.hogander@nokia.com>
Tue, 22 Sep 2009 23:46:58 +0000 (16:46 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 23 Sep 2009 14:39:50 +0000 (07:39 -0700)
Check wether fbdev is NULL in suspend / resume functions. Fbdev is
NULL, if there is no lcd or it is not enabled in configuration.

Signed-off-by: Jouni Hogander <jouni.hogander@nokia.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Imre Deak <imre.deak@nokia.com>
Acked-by: Krzysztof Helt <krzysztof.h1@wp.pl>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/video/omap/omapfb_main.c

index db05f7e316e7a6d9f688882a33f01720f16888fa..7eab0f0b4ccf7dd0d8f662bbd1a28d700ca9a9b7 100644 (file)
@@ -1846,8 +1846,8 @@ static int omapfb_suspend(struct platform_device *pdev, pm_message_t mesg)
 {
        struct omapfb_device *fbdev = platform_get_drvdata(pdev);
 
-       omapfb_blank(FB_BLANK_POWERDOWN, fbdev->fb_info[0]);
-
+       if (fbdev != NULL)
+               omapfb_blank(FB_BLANK_POWERDOWN, fbdev->fb_info[0]);
        return 0;
 }
 
@@ -1856,7 +1856,8 @@ static int omapfb_resume(struct platform_device *pdev)
 {
        struct omapfb_device *fbdev = platform_get_drvdata(pdev);
 
-       omapfb_blank(FB_BLANK_UNBLANK, fbdev->fb_info[0]);
+       if (fbdev != NULL)
+               omapfb_blank(FB_BLANK_UNBLANK, fbdev->fb_info[0]);
        return 0;
 }