neofb: remove open_lock mutex
authorKrzysztof Helt <krzysztof.h1@wp.pl>
Thu, 16 Oct 2008 05:03:33 +0000 (22:03 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 16 Oct 2008 18:21:42 +0000 (11:21 -0700)
Remove mutex from the fb_open/fb_release functions as these operations are
mutexed at fb layer.

Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/video/neofb.c
include/video/neomagic.h

index dea864552588db5a8fbd424f869e85994fa56313..bfb802d26d5af7286a59364c15f50ca9f881e97e 100644 (file)
@@ -557,14 +557,12 @@ neofb_open(struct fb_info *info, int user)
 {
        struct neofb_par *par = info->par;
 
-       mutex_lock(&par->open_lock);
        if (!par->ref_count) {
                memset(&par->state, 0, sizeof(struct vgastate));
                par->state.flags = VGA_SAVE_MODE | VGA_SAVE_FONTS;
                save_vga(&par->state);
        }
        par->ref_count++;
-       mutex_unlock(&par->open_lock);
 
        return 0;
 }
@@ -574,16 +572,13 @@ neofb_release(struct fb_info *info, int user)
 {
        struct neofb_par *par = info->par;
 
-       mutex_lock(&par->open_lock);
-       if (!par->ref_count) {
-               mutex_unlock(&par->open_lock);
+       if (!par->ref_count)
                return -EINVAL;
-       }
+
        if (par->ref_count == 1) {
                restore_vga(&par->state);
        }
        par->ref_count--;
-       mutex_unlock(&par->open_lock);
 
        return 0;
 }
@@ -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;
 
-       mutex_init(&par->open_lock);
        par->pci_burst = !nopciburst;
        par->lcd_stretch = !nostretch;
        par->libretto = libretto;
index 38910da0ae59f083c27312674413c73e4a32034b..08b663782956a3aa3f295acc17c7bf581173ca83 100644 (file)
@@ -123,7 +123,6 @@ typedef volatile struct {
 
 struct neofb_par {
        struct vgastate state;
-       struct mutex open_lock;
        unsigned int ref_count;
 
        unsigned char MiscOutReg;       /* Misc */