Commit 3a568051 authored by Krzysztof Helt's avatar Krzysztof Helt Committed by Linus Torvalds

neofb: 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 9c8db4a2
...@@ -557,14 +557,12 @@ neofb_open(struct fb_info *info, int user) ...@@ -557,14 +557,12 @@ neofb_open(struct fb_info *info, int user)
{ {
struct neofb_par *par = info->par; struct neofb_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_MODE | VGA_SAVE_FONTS; par->state.flags = VGA_SAVE_MODE | VGA_SAVE_FONTS;
save_vga(&par->state); save_vga(&par->state);
} }
par->ref_count++; par->ref_count++;
mutex_unlock(&par->open_lock);
return 0; return 0;
} }
...@@ -574,16 +572,13 @@ neofb_release(struct fb_info *info, int user) ...@@ -574,16 +572,13 @@ neofb_release(struct fb_info *info, int user)
{ {
struct neofb_par *par = info->par; struct neofb_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;
} }
...@@ -1958,7 +1953,6 @@ static struct fb_info *__devinit neo_alloc_fb_info(struct pci_dev *dev, const st ...@@ -1958,7 +1953,6 @@ static struct fb_info *__devinit neo_alloc_fb_info(struct pci_dev *dev, const st
info->fix.accel = id->driver_data; info->fix.accel = id->driver_data;
mutex_init(&par->open_lock);
par->pci_burst = !nopciburst; par->pci_burst = !nopciburst;
par->lcd_stretch = !nostretch; par->lcd_stretch = !nostretch;
par->libretto = libretto; par->libretto = libretto;
......
...@@ -123,7 +123,6 @@ typedef volatile struct { ...@@ -123,7 +123,6 @@ typedef volatile struct {
struct neofb_par { struct neofb_par {
struct vgastate state; struct vgastate state;
struct mutex open_lock;
unsigned int ref_count; unsigned int ref_count;
unsigned char MiscOutReg; /* Misc */ unsigned char MiscOutReg; /* Misc */
......
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