Commit 9c8db4a2 authored by Krzysztof Helt's avatar Krzysztof Helt Committed by Linus Torvalds

vga16fb: remove open_lock mutex

Remove mutex from the fb_open/fb_release functions as these operations are
mutexed at fb layer.
Signed-off-by: default avatarKrzysztof Helt <krzysztof.h1@wp.pl>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 0716a8ea
...@@ -58,7 +58,6 @@ struct vga16fb_par { ...@@ -58,7 +58,6 @@ struct vga16fb_par {
unsigned char ClockingMode; /* Seq-Controller:01h */ unsigned char ClockingMode; /* Seq-Controller:01h */
} vga_state; } vga_state;
struct vgastate state; struct vgastate state;
struct mutex open_lock;
unsigned int ref_count; unsigned int ref_count;
int palette_blanked, vesa_blanked, mode, isVGA; int palette_blanked, vesa_blanked, mode, isVGA;
u8 misc, pel_msk, vss, clkdiv; u8 misc, pel_msk, vss, clkdiv;
...@@ -286,7 +285,6 @@ static int vga16fb_open(struct fb_info *info, int user) ...@@ -286,7 +285,6 @@ static int vga16fb_open(struct fb_info *info, int user)
{ {
struct vga16fb_par *par = info->par; struct vga16fb_par *par = info->par;
mutex_lock(&par->open_lock);
if (!par->ref_count) { if (!par->ref_count) {
memset(&par->state, 0, sizeof(struct vgastate)); memset(&par->state, 0, sizeof(struct vgastate));
par->state.flags = VGA_SAVE_FONTS | VGA_SAVE_MODE | par->state.flags = VGA_SAVE_FONTS | VGA_SAVE_MODE |
...@@ -294,7 +292,6 @@ static int vga16fb_open(struct fb_info *info, int user) ...@@ -294,7 +292,6 @@ static int vga16fb_open(struct fb_info *info, int user)
save_vga(&par->state); save_vga(&par->state);
} }
par->ref_count++; par->ref_count++;
mutex_unlock(&par->open_lock);
return 0; return 0;
} }
...@@ -303,15 +300,12 @@ static int vga16fb_release(struct fb_info *info, int user) ...@@ -303,15 +300,12 @@ static int vga16fb_release(struct fb_info *info, int user)
{ {
struct vga16fb_par *par = info->par; struct vga16fb_par *par = info->par;
mutex_lock(&par->open_lock); if (!par->ref_count)
if (!par->ref_count) {
mutex_unlock(&par->open_lock);
return -EINVAL; return -EINVAL;
}
if (par->ref_count == 1) if (par->ref_count == 1)
restore_vga(&par->state); restore_vga(&par->state);
par->ref_count--; par->ref_count--;
mutex_unlock(&par->open_lock);
return 0; return 0;
} }
...@@ -1326,7 +1320,6 @@ static int __init vga16fb_probe(struct platform_device *dev) ...@@ -1326,7 +1320,6 @@ static int __init vga16fb_probe(struct platform_device *dev)
printk(KERN_INFO "vga16fb: mapped to 0x%p\n", info->screen_base); printk(KERN_INFO "vga16fb: mapped to 0x%p\n", info->screen_base);
par = info->par; par = info->par;
mutex_init(&par->open_lock);
par->isVGA = screen_info.orig_video_isVGA; par->isVGA = screen_info.orig_video_isVGA;
par->palette_blanked = 0; par->palette_blanked = 0;
par->vesa_blanked = 0; par->vesa_blanked = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment