aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/saa5246a.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video/saa5246a.c')
-rw-r--r--drivers/media/video/saa5246a.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/media/video/saa5246a.c b/drivers/media/video/saa5246a.c
index 2ce010201308..dd830e0e5e96 100644
--- a/drivers/media/video/saa5246a.c
+++ b/drivers/media/video/saa5246a.c
@@ -46,6 +46,8 @@
46#include <linux/i2c.h> 46#include <linux/i2c.h>
47#include <linux/videotext.h> 47#include <linux/videotext.h>
48#include <linux/videodev.h> 48#include <linux/videodev.h>
49#include <linux/mutex.h>
50
49#include "saa5246a.h" 51#include "saa5246a.h"
50 52
51MODULE_AUTHOR("Michael Geng <linux@MichaelGeng.de>"); 53MODULE_AUTHOR("Michael Geng <linux@MichaelGeng.de>");
@@ -57,7 +59,7 @@ struct saa5246a_device
57 u8 pgbuf[NUM_DAUS][VTX_VIRTUALSIZE]; 59 u8 pgbuf[NUM_DAUS][VTX_VIRTUALSIZE];
58 int is_searching[NUM_DAUS]; 60 int is_searching[NUM_DAUS];
59 struct i2c_client *client; 61 struct i2c_client *client;
60 struct semaphore lock; 62 struct mutex lock;
61}; 63};
62 64
63static struct video_device saa_template; /* Declared near bottom */ 65static struct video_device saa_template; /* Declared near bottom */
@@ -90,7 +92,7 @@ static int saa5246a_attach(struct i2c_adapter *adap, int addr, int kind)
90 return -ENOMEM; 92 return -ENOMEM;
91 } 93 }
92 strlcpy(client->name, IF_NAME, I2C_NAME_SIZE); 94 strlcpy(client->name, IF_NAME, I2C_NAME_SIZE);
93 init_MUTEX(&t->lock); 95 mutex_init(&t->lock);
94 96
95 /* 97 /*
96 * Now create a video4linux device 98 * Now create a video4linux device
@@ -719,9 +721,9 @@ static int saa5246a_ioctl(struct inode *inode, struct file *file,
719 int err; 721 int err;
720 722
721 cmd = vtx_fix_command(cmd); 723 cmd = vtx_fix_command(cmd);
722 down(&t->lock); 724 mutex_lock(&t->lock);
723 err = video_usercopy(inode, file, cmd, arg, do_saa5246a_ioctl); 725 err = video_usercopy(inode, file, cmd, arg, do_saa5246a_ioctl);
724 up(&t->lock); 726 mutex_unlock(&t->lock);
725 return err; 727 return err;
726} 728}
727 729