diff options
author | Magnus Damm <damm@igel.co.jp> | 2008-12-19 01:34:09 -0500 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2008-12-22 04:44:48 -0500 |
commit | 87884bd8ae42c875adbd62c84f47ed1cbb3e5090 (patch) | |
tree | 93f4632aac9c3a3579702e4b3a5dad16b5c27fa1 | |
parent | 0790555437df2b6070af8f021b8d2ef79e70e144 (diff) |
video: fix deferred io fsync()
If CONFIG_FB_DEFERRED_IO is set, but there are framebuffers
registered that does not make use of deferred io, then fsync()
on those framebuffers will result in a crash. Fix that.
This is needed for sh_mobile_lcdcfb since we always enable
deferred io at compile time but we may disable deferred io
for some types of hardware configurations.
Signed-off-by: Magnus Damm <damm@igel.co.jp>
Acked-by: Jaya Kumar <jayakumar.lkml@gmail.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
-rw-r--r-- | drivers/video/fb_defio.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/video/fb_defio.c b/drivers/video/fb_defio.c index 4835bdc4e9f1..e6dafeddfa5b 100644 --- a/drivers/video/fb_defio.c +++ b/drivers/video/fb_defio.c | |||
@@ -60,6 +60,10 @@ int fb_deferred_io_fsync(struct file *file, struct dentry *dentry, int datasync) | |||
60 | { | 60 | { |
61 | struct fb_info *info = file->private_data; | 61 | struct fb_info *info = file->private_data; |
62 | 62 | ||
63 | /* Skip if deferred io is complied-in but disabled on this fbdev */ | ||
64 | if (!info->fbdefio) | ||
65 | return 0; | ||
66 | |||
63 | /* Kill off the delayed work */ | 67 | /* Kill off the delayed work */ |
64 | cancel_rearming_delayed_work(&info->deferred_work); | 68 | cancel_rearming_delayed_work(&info->deferred_work); |
65 | 69 | ||