[PATCH] vga16fb: remove open_lock mutex
DORMANTno replies
From: Krzysztof Helt <hidden>
Date: 2008-08-24 06:42:31
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/vga16fb.c linux-2.6/drivers/video/vga16fb.c
--- linux-ref/drivers/video/vga16fb.c 2008-08-09 05:09:05.000000000 +0200
+++ linux-2.6/drivers/video/vga16fb.c 2008-08-25 03:10:07.000000000 +0200@@ -58,7 +58,6 @@ struct vga16fb_par { unsigned char ClockingMode; /* Seq-Controller:01h */ } vga_state; struct vgastate state; - struct mutex open_lock; unsigned int ref_count; int palette_blanked, vesa_blanked, mode, isVGA; u8 misc, pel_msk, vss, clkdiv;
@@ -286,7 +285,6 @@ static int vga16fb_open(struct fb_info * { struct vga16fb_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_FONTS | VGA_SAVE_MODE |
@@ -294,7 +292,6 @@ static int vga16fb_open(struct fb_info * save_vga(&par->state); } par->ref_count++; - mutex_unlock(&par->open_lock); return 0; }
@@ -303,15 +300,12 @@ static int vga16fb_release(struct fb_inf { struct vga16fb_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; }
@@ -1326,7 +1320,6 @@ static int __init vga16fb_probe(struct p printk(KERN_INFO "vga16fb: mapped to 0x%p\n", info->screen_base); par = info->par; - mutex_init(&par->open_lock); par->isVGA = screen_info.orig_video_isVGA; par->palette_blanked = 0; par->vesa_blanked = 0; ----------------------------------------------------------------------
Alergia na seks?
------------------------------------------------------------------------- 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=/