[PATCH] neofb: remove open_lock mutex
From: Krzysztof Helt <hidden>
Date: 2008-08-24 06:53:53
From: Krzysztof Helt <redacted> Remove mutex from the fb_open/fb_release functions as these operations are mutexed at fb layer. Signed-off-by: Krzysztof Helt <redacted> --- diff -urp linux-ref/drivers/video/neofb.c linux-2.6/drivers/video/neofb.c
--- linux-ref/drivers/video/neofb.c 2008-08-25 03:08:04.000000000 +0200
+++ linux-2.6/drivers/video/neofb.c 2008-08-25 03:09:38.000000000 +0200@@ -557,14 +557,12 @@ neofb_open(struct fb_info *info, int use { 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 { 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; }
@@ -1957,7 +1952,6 @@ static struct fb_info *__devinit neo_all info->fix.accel = id->driver_data; - mutex_init(&par->open_lock); par->pci_burst = !nopciburst; par->lcd_stretch = !nostretch; par->libretto = libretto;
diff -urp linux-ref/include/video/neomagic.h linux-2.6/include/video/neomagic.h
--- linux-ref/include/video/neomagic.h 2008-08-09 05:09:31.000000000 +0200
+++ linux-2.6/include/video/neomagic.h 2008-08-25 03:09:07.000000000 +0200@@ -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 */ ----------------------------------------------------------------------
Nie szukam kochanka!
------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/