aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/video/neofb.c10
-rw-r--r--include/video/neomagic.h1
2 files changed, 2 insertions, 9 deletions
diff --git a/drivers/video/neofb.c b/drivers/video/neofb.c
index dea864552588..bfb802d26d5a 100644
--- a/drivers/video/neofb.c
+++ b/drivers/video/neofb.c
@@ -557,14 +557,12 @@ neofb_open(struct fb_info *info, int user)
557{ 557{
558 struct neofb_par *par = info->par; 558 struct neofb_par *par = info->par;
559 559
560 mutex_lock(&par->open_lock);
561 if (!par->ref_count) { 560 if (!par->ref_count) {
562 memset(&par->state, 0, sizeof(struct vgastate)); 561 memset(&par->state, 0, sizeof(struct vgastate));
563 par->state.flags = VGA_SAVE_MODE | VGA_SAVE_FONTS; 562 par->state.flags = VGA_SAVE_MODE | VGA_SAVE_FONTS;
564 save_vga(&par->state); 563 save_vga(&par->state);
565 } 564 }
566 par->ref_count++; 565 par->ref_count++;
567 mutex_unlock(&par->open_lock);
568 566
569 return 0; 567 return 0;
570} 568}
@@ -574,16 +572,13 @@ neofb_release(struct fb_info *info, int user)
574{ 572{
575 struct neofb_par *par = info->par; 573 struct neofb_par *par = info->par;
576 574
577 mutex_lock(&par->open_lock); 575 if (!par->ref_count)
578 if (!par->ref_count) {
579 mutex_unlock(&par->open_lock);
580 return -EINVAL; 576 return -EINVAL;
581 } 577
582 if (par->ref_count == 1) { 578 if (par->ref_count == 1) {
583 restore_vga(&par->state); 579 restore_vga(&par->state);
584 } 580 }
585 par->ref_count--; 581 par->ref_count--;
586 mutex_unlock(&par->open_lock);
587 582
588 return 0; 583 return 0;
589} 584}
@@ -1958,7 +1953,6 @@ static struct fb_info *__devinit neo_alloc_fb_info(struct pci_dev *dev, const st
1958 1953
1959 info->fix.accel = id->driver_data; 1954 info->fix.accel = id->driver_data;
1960 1955
1961 mutex_init(&par->open_lock);
1962 par->pci_burst = !nopciburst; 1956 par->pci_burst = !nopciburst;
1963 par->lcd_stretch = !nostretch; 1957 par->lcd_stretch = !nostretch;
1964 par->libretto = libretto; 1958 par->libretto = libretto;
diff --git a/include/video/neomagic.h b/include/video/neomagic.h
index 38910da0ae59..08b663782956 100644
--- a/include/video/neomagic.h
+++ b/include/video/neomagic.h
@@ -123,7 +123,6 @@ typedef volatile struct {
123 123
124struct neofb_par { 124struct neofb_par {
125 struct vgastate state; 125 struct vgastate state;
126 struct mutex open_lock;
127 unsigned int ref_count; 126 unsigned int ref_count;
128 127
129 unsigned char MiscOutReg; /* Misc */ 128 unsigned char MiscOutReg; /* Misc */