aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb/b2c2
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2006-02-07 03:49:14 -0500
committerMauro Carvalho Chehab <mchehab@infradead.org>2006-02-07 03:49:14 -0500
commit3593cab5d62c4c7abced1076710f9bc2d8847433 (patch)
treedd5dc21961f6b4aef6900b0c2eb63ce7c70aecd5 /drivers/media/dvb/b2c2
parent538f9630afbbe429ecbcdcf92536200293a8e4b3 (diff)
V4L/DVB (3318b): sem2mutex: drivers/media/, #2
Semaphore to mutex conversion. The conversion was generated via scripts, and the result was validated automatically via a script as well. Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/dvb/b2c2')
-rw-r--r--drivers/media/dvb/b2c2/flexcop-common.h4
-rw-r--r--drivers/media/dvb/b2c2/flexcop-i2c.c6
2 files changed, 5 insertions, 5 deletions
diff --git a/drivers/media/dvb/b2c2/flexcop-common.h b/drivers/media/dvb/b2c2/flexcop-common.h
index 7d7e1613c5a..b3dd0603cd9 100644
--- a/drivers/media/dvb/b2c2/flexcop-common.h
+++ b/drivers/media/dvb/b2c2/flexcop-common.h
@@ -10,6 +10,7 @@
10 10
11#include <linux/config.h> 11#include <linux/config.h>
12#include <linux/pci.h> 12#include <linux/pci.h>
13#include <linux/mutex.h>
13 14
14#include "flexcop-reg.h" 15#include "flexcop-reg.h"
15 16
@@ -73,8 +74,7 @@ struct flexcop_device {
73 int (*fe_sleep) (struct dvb_frontend *); 74 int (*fe_sleep) (struct dvb_frontend *);
74 75
75 struct i2c_adapter i2c_adap; 76 struct i2c_adapter i2c_adap;
76 struct semaphore i2c_sem; 77 struct mutex i2c_mutex;
77
78 struct module *owner; 78 struct module *owner;
79 79
80 /* options and status */ 80 /* options and status */
diff --git a/drivers/media/dvb/b2c2/flexcop-i2c.c b/drivers/media/dvb/b2c2/flexcop-i2c.c
index 56495cb6cd0..e0bd2d8f0f0 100644
--- a/drivers/media/dvb/b2c2/flexcop-i2c.c
+++ b/drivers/media/dvb/b2c2/flexcop-i2c.c
@@ -135,7 +135,7 @@ static int flexcop_master_xfer(struct i2c_adapter *i2c_adap, struct i2c_msg msgs
135 struct flexcop_device *fc = i2c_get_adapdata(i2c_adap); 135 struct flexcop_device *fc = i2c_get_adapdata(i2c_adap);
136 int i, ret = 0; 136 int i, ret = 0;
137 137
138 if (down_interruptible(&fc->i2c_sem)) 138 if (mutex_lock_interruptible(&fc->i2c_mutex))
139 return -ERESTARTSYS; 139 return -ERESTARTSYS;
140 140
141 /* reading */ 141 /* reading */
@@ -161,7 +161,7 @@ static int flexcop_master_xfer(struct i2c_adapter *i2c_adap, struct i2c_msg msgs
161 else 161 else
162 ret = num; 162 ret = num;
163 163
164 up(&fc->i2c_sem); 164 mutex_unlock(&fc->i2c_mutex);
165 165
166 return ret; 166 return ret;
167} 167}
@@ -180,7 +180,7 @@ int flexcop_i2c_init(struct flexcop_device *fc)
180{ 180{
181 int ret; 181 int ret;
182 182
183 sema_init(&fc->i2c_sem,1); 183 mutex_init(&fc->i2c_mutex);
184 184
185 memset(&fc->i2c_adap, 0, sizeof(struct i2c_adapter)); 185 memset(&fc->i2c_adap, 0, sizeof(struct i2c_adapter));
186 strncpy(fc->i2c_adap.name, "B2C2 FlexCop device",I2C_NAME_SIZE); 186 strncpy(fc->i2c_adap.name, "B2C2 FlexCop device",I2C_NAME_SIZE);