summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorBen Dooks <ben-linux@fluff.org>2008-02-06 01:39:38 -0800
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2008-02-06 10:41:17 -0800
commit40488db20e3f43e65f10747f9026fba7d59d29a3 (patch)
tree58c2258f30223f74230dc3606d9df888a1d42f0d /drivers
parentbc9c6a175fa8123587668c38959a105e3ccb6bbd (diff)
downloadlinux-40488db20e3f43e65f10747f9026fba7d59d29a3.tar.bz2
FB/SM501: ensure console suspended before saving state
Move the console suspend to before we save the state of the framebuffer to ensure that it does not try and change the fb state again once we have copied it out. Signed-off-by: Ben Dooks <ben-linux@fluff.org> Cc: "Antonino A. Daplas" <adaplas@pol.net> Cc: Vincent Sanders <vince@simtec.co.uk> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/video/sm501fb.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/drivers/video/sm501fb.c b/drivers/video/sm501fb.c
index 8c39e4d5b08f..e83dfba7e636 100644
--- a/drivers/video/sm501fb.c
+++ b/drivers/video/sm501fb.c
@@ -1698,6 +1698,15 @@ static int sm501fb_suspend_fb(struct sm501fb_info *info,
if (par->screen.size == 0)
return 0;
+ /* blank the relevant interface to ensure unit power minimised */
+ (par->ops.fb_blank)(FB_BLANK_POWERDOWN, fbi);
+
+ /* tell console/fb driver we are suspending */
+
+ acquire_console_sem();
+ fb_set_suspend(fbi, 1);
+ release_console_sem();
+
/* backup copies in case chip is powered down over suspend */
par->store_fb = vmalloc(par->screen.size);
@@ -1717,12 +1726,6 @@ static int sm501fb_suspend_fb(struct sm501fb_info *info,
memcpy_fromio(par->store_fb, par->screen.k_addr, par->screen.size);
memcpy_fromio(par->store_cursor, par->cursor.k_addr, par->cursor.size);
- /* blank the relevant interface to ensure unit power minimised */
- (par->ops.fb_blank)(FB_BLANK_POWERDOWN, fbi);
-
- acquire_console_sem();
- fb_set_suspend(fbi, 1);
- release_console_sem();
return 0;