From 87884bd8ae42c875adbd62c84f47ed1cbb3e5090 Mon Sep 17 00:00:00 2001 From: Magnus Damm Date: Fri, 19 Dec 2008 15:34:09 +0900 Subject: 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 Acked-by: Jaya Kumar Signed-off-by: Paul Mundt --- drivers/video/fb_defio.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'drivers/video') 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) { struct fb_info *info = file->private_data; + /* Skip if deferred io is complied-in but disabled on this fbdev */ + if (!info->fbdefio) + return 0; + /* Kill off the delayed work */ cancel_rearming_delayed_work(&info->deferred_work); -- cgit v1.2.2