Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 114844
b: refs/heads/master
c: 9c8db4a
h: refs/heads/master
v: v3
  • Loading branch information
Krzysztof Helt authored and Linus Torvalds committed Oct 16, 2008
1 parent 21452f0 commit 3eca3ea
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 0716a8eab3c8d21b4e36839fa0ee26abbf8e01ef
refs/heads/master: 9c8db4a265ee5000d8c21634277ec1eb9ceebc7f
11 changes: 2 additions & 9 deletions trunk/drivers/video/vga16fb.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -286,15 +285,13 @@ static int vga16fb_open(struct fb_info *info, int user)
{
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 |
VGA_SAVE_CMAP;
save_vga(&par->state);
}
par->ref_count++;
mutex_unlock(&par->open_lock);

return 0;
}
Expand All @@ -303,15 +300,12 @@ static int vga16fb_release(struct fb_info *info, int user)
{
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;
}
Expand Down Expand Up @@ -1326,7 +1320,6 @@ static int __init vga16fb_probe(struct platform_device *dev)
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;
Expand Down

0 comments on commit 3eca3ea

Please sign in to comment.