diff options
author | Ingo Molnar <mingo@elte.hu> | 2006-02-07 03:49:14 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2006-02-07 03:49:14 -0500 |
commit | 3593cab5d62c4c7abced1076710f9bc2d8847433 (patch) | |
tree | dd5dc21961f6b4aef6900b0c2eb63ce7c70aecd5 /drivers/media/dvb/dvb-usb | |
parent | 538f9630afbbe429ecbcdcf92536200293a8e4b3 (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/dvb-usb')
-rw-r--r-- | drivers/media/dvb/dvb-usb/cxusb.c | 4 | ||||
-rw-r--r-- | drivers/media/dvb/dvb-usb/dibusb-common.c | 4 | ||||
-rw-r--r-- | drivers/media/dvb/dvb-usb/digitv.c | 4 | ||||
-rw-r--r-- | drivers/media/dvb/dvb-usb/dvb-usb-init.c | 4 | ||||
-rw-r--r-- | drivers/media/dvb/dvb-usb/dvb-usb-urb.c | 4 | ||||
-rw-r--r-- | drivers/media/dvb/dvb-usb/dvb-usb.h | 9 | ||||
-rw-r--r-- | drivers/media/dvb/dvb-usb/vp702x.c | 4 | ||||
-rw-r--r-- | drivers/media/dvb/dvb-usb/vp7045.c | 4 |
8 files changed, 19 insertions, 18 deletions
diff --git a/drivers/media/dvb/dvb-usb/cxusb.c b/drivers/media/dvb/dvb-usb/cxusb.c index f327fac1688e..e62a293c7e5a 100644 --- a/drivers/media/dvb/dvb-usb/cxusb.c +++ b/drivers/media/dvb/dvb-usb/cxusb.c | |||
@@ -77,7 +77,7 @@ static int cxusb_i2c_xfer(struct i2c_adapter *adap,struct i2c_msg msg[],int num) | |||
77 | struct dvb_usb_device *d = i2c_get_adapdata(adap); | 77 | struct dvb_usb_device *d = i2c_get_adapdata(adap); |
78 | int i; | 78 | int i; |
79 | 79 | ||
80 | if (down_interruptible(&d->i2c_sem) < 0) | 80 | if (mutex_lock_interruptible(&d->i2c_mutex) < 0) |
81 | return -EAGAIN; | 81 | return -EAGAIN; |
82 | 82 | ||
83 | if (num > 2) | 83 | if (num > 2) |
@@ -126,7 +126,7 @@ static int cxusb_i2c_xfer(struct i2c_adapter *adap,struct i2c_msg msg[],int num) | |||
126 | } | 126 | } |
127 | } | 127 | } |
128 | 128 | ||
129 | up(&d->i2c_sem); | 129 | mutex_unlock(&d->i2c_mutex); |
130 | return i; | 130 | return i; |
131 | } | 131 | } |
132 | 132 | ||
diff --git a/drivers/media/dvb/dvb-usb/dibusb-common.c b/drivers/media/dvb/dvb-usb/dibusb-common.c index 269d899da488..2d52b76671d3 100644 --- a/drivers/media/dvb/dvb-usb/dibusb-common.c +++ b/drivers/media/dvb/dvb-usb/dibusb-common.c | |||
@@ -128,7 +128,7 @@ static int dibusb_i2c_xfer(struct i2c_adapter *adap,struct i2c_msg msg[],int num | |||
128 | struct dvb_usb_device *d = i2c_get_adapdata(adap); | 128 | struct dvb_usb_device *d = i2c_get_adapdata(adap); |
129 | int i; | 129 | int i; |
130 | 130 | ||
131 | if (down_interruptible(&d->i2c_sem) < 0) | 131 | if (mutex_lock_interruptible(&d->i2c_mutex) < 0) |
132 | return -EAGAIN; | 132 | return -EAGAIN; |
133 | 133 | ||
134 | if (num > 2) | 134 | if (num > 2) |
@@ -146,7 +146,7 @@ static int dibusb_i2c_xfer(struct i2c_adapter *adap,struct i2c_msg msg[],int num | |||
146 | break; | 146 | break; |
147 | } | 147 | } |
148 | 148 | ||
149 | up(&d->i2c_sem); | 149 | mutex_unlock(&d->i2c_mutex); |
150 | return i; | 150 | return i; |
151 | } | 151 | } |
152 | 152 | ||
diff --git a/drivers/media/dvb/dvb-usb/digitv.c b/drivers/media/dvb/dvb-usb/digitv.c index caa1346e3063..91136c00ce9d 100644 --- a/drivers/media/dvb/dvb-usb/digitv.c +++ b/drivers/media/dvb/dvb-usb/digitv.c | |||
@@ -48,7 +48,7 @@ static int digitv_i2c_xfer(struct i2c_adapter *adap,struct i2c_msg msg[],int num | |||
48 | struct dvb_usb_device *d = i2c_get_adapdata(adap); | 48 | struct dvb_usb_device *d = i2c_get_adapdata(adap); |
49 | int i; | 49 | int i; |
50 | 50 | ||
51 | if (down_interruptible(&d->i2c_sem) < 0) | 51 | if (mutex_lock_interruptible(&d->i2c_mutex) < 0) |
52 | return -EAGAIN; | 52 | return -EAGAIN; |
53 | 53 | ||
54 | if (num > 2) | 54 | if (num > 2) |
@@ -67,7 +67,7 @@ static int digitv_i2c_xfer(struct i2c_adapter *adap,struct i2c_msg msg[],int num | |||
67 | break; | 67 | break; |
68 | } | 68 | } |
69 | 69 | ||
70 | up(&d->i2c_sem); | 70 | mutex_unlock(&d->i2c_mutex); |
71 | return i; | 71 | return i; |
72 | } | 72 | } |
73 | 73 | ||
diff --git a/drivers/media/dvb/dvb-usb/dvb-usb-init.c b/drivers/media/dvb/dvb-usb/dvb-usb-init.c index 716f8bf528cd..4258a995dce1 100644 --- a/drivers/media/dvb/dvb-usb/dvb-usb-init.c +++ b/drivers/media/dvb/dvb-usb/dvb-usb-init.c | |||
@@ -42,8 +42,8 @@ static int dvb_usb_init(struct dvb_usb_device *d) | |||
42 | { | 42 | { |
43 | int ret = 0; | 43 | int ret = 0; |
44 | 44 | ||
45 | sema_init(&d->usb_sem, 1); | 45 | mutex_init(&d->usb_mutex); |
46 | sema_init(&d->i2c_sem, 1); | 46 | mutex_init(&d->i2c_mutex); |
47 | 47 | ||
48 | d->state = DVB_USB_STATE_INIT; | 48 | d->state = DVB_USB_STATE_INIT; |
49 | 49 | ||
diff --git a/drivers/media/dvb/dvb-usb/dvb-usb-urb.c b/drivers/media/dvb/dvb-usb/dvb-usb-urb.c index ee821974dc60..9002f35aa952 100644 --- a/drivers/media/dvb/dvb-usb/dvb-usb-urb.c +++ b/drivers/media/dvb/dvb-usb/dvb-usb-urb.c | |||
@@ -21,7 +21,7 @@ int dvb_usb_generic_rw(struct dvb_usb_device *d, u8 *wbuf, u16 wlen, u8 *rbuf, | |||
21 | if (wbuf == NULL || wlen == 0) | 21 | if (wbuf == NULL || wlen == 0) |
22 | return -EINVAL; | 22 | return -EINVAL; |
23 | 23 | ||
24 | if ((ret = down_interruptible(&d->usb_sem))) | 24 | if ((ret = mutex_lock_interruptible(&d->usb_mutex))) |
25 | return ret; | 25 | return ret; |
26 | 26 | ||
27 | deb_xfer(">>> "); | 27 | deb_xfer(">>> "); |
@@ -53,7 +53,7 @@ int dvb_usb_generic_rw(struct dvb_usb_device *d, u8 *wbuf, u16 wlen, u8 *rbuf, | |||
53 | } | 53 | } |
54 | } | 54 | } |
55 | 55 | ||
56 | up(&d->usb_sem); | 56 | mutex_unlock(&d->usb_mutex); |
57 | return ret; | 57 | return ret; |
58 | } | 58 | } |
59 | EXPORT_SYMBOL(dvb_usb_generic_rw); | 59 | EXPORT_SYMBOL(dvb_usb_generic_rw); |
diff --git a/drivers/media/dvb/dvb-usb/dvb-usb.h b/drivers/media/dvb/dvb-usb/dvb-usb.h index 5e5d21ad93c9..d2be37cc43b7 100644 --- a/drivers/media/dvb/dvb-usb/dvb-usb.h +++ b/drivers/media/dvb/dvb-usb/dvb-usb.h | |||
@@ -12,6 +12,7 @@ | |||
12 | #include <linux/input.h> | 12 | #include <linux/input.h> |
13 | #include <linux/usb.h> | 13 | #include <linux/usb.h> |
14 | #include <linux/firmware.h> | 14 | #include <linux/firmware.h> |
15 | #include <linux/mutex.h> | ||
15 | 16 | ||
16 | #include "dvb_frontend.h" | 17 | #include "dvb_frontend.h" |
17 | #include "dvb_demux.h" | 18 | #include "dvb_demux.h" |
@@ -227,8 +228,8 @@ struct dvb_usb_properties { | |||
227 | * @feedcount: number of reqested feeds (used for streaming-activation) | 228 | * @feedcount: number of reqested feeds (used for streaming-activation) |
228 | * @pid_filtering: is hardware pid_filtering used or not. | 229 | * @pid_filtering: is hardware pid_filtering used or not. |
229 | * | 230 | * |
230 | * @usb_sem: semaphore of USB control messages (reading needs two messages) | 231 | * @usb_mutex: semaphore of USB control messages (reading needs two messages) |
231 | * @i2c_sem: semaphore for i2c-transfers | 232 | * @i2c_mutex: semaphore for i2c-transfers |
232 | * | 233 | * |
233 | * @i2c_adap: device's i2c_adapter if it uses I2CoverUSB | 234 | * @i2c_adap: device's i2c_adapter if it uses I2CoverUSB |
234 | * @pll_addr: I2C address of the tuner for programming | 235 | * @pll_addr: I2C address of the tuner for programming |
@@ -283,10 +284,10 @@ struct dvb_usb_device { | |||
283 | int pid_filtering; | 284 | int pid_filtering; |
284 | 285 | ||
285 | /* locking */ | 286 | /* locking */ |
286 | struct semaphore usb_sem; | 287 | struct mutex usb_mutex; |
287 | 288 | ||
288 | /* i2c */ | 289 | /* i2c */ |
289 | struct semaphore i2c_sem; | 290 | struct mutex i2c_mutex; |
290 | struct i2c_adapter i2c_adap; | 291 | struct i2c_adapter i2c_adap; |
291 | 292 | ||
292 | /* tuner programming information */ | 293 | /* tuner programming information */ |
diff --git a/drivers/media/dvb/dvb-usb/vp702x.c b/drivers/media/dvb/dvb-usb/vp702x.c index 4a95eca81c5c..b2f098a2d5f7 100644 --- a/drivers/media/dvb/dvb-usb/vp702x.c +++ b/drivers/media/dvb/dvb-usb/vp702x.c | |||
@@ -75,7 +75,7 @@ int vp702x_usb_inout_op(struct dvb_usb_device *d, u8 *o, int olen, u8 *i, int il | |||
75 | { | 75 | { |
76 | int ret; | 76 | int ret; |
77 | 77 | ||
78 | if ((ret = down_interruptible(&d->usb_sem))) | 78 | if ((ret = mutex_lock_interruptible(&d->usb_mutex))) |
79 | return ret; | 79 | return ret; |
80 | 80 | ||
81 | if ((ret = vp702x_usb_out_op(d,REQUEST_OUT,0,0,o,olen)) < 0) | 81 | if ((ret = vp702x_usb_out_op(d,REQUEST_OUT,0,0,o,olen)) < 0) |
@@ -84,7 +84,7 @@ int vp702x_usb_inout_op(struct dvb_usb_device *d, u8 *o, int olen, u8 *i, int il | |||
84 | ret = vp702x_usb_in_op(d,REQUEST_IN,0,0,i,ilen); | 84 | ret = vp702x_usb_in_op(d,REQUEST_IN,0,0,i,ilen); |
85 | 85 | ||
86 | unlock: | 86 | unlock: |
87 | up(&d->usb_sem); | 87 | mutex_unlock(&d->usb_mutex); |
88 | 88 | ||
89 | return ret; | 89 | return ret; |
90 | } | 90 | } |
diff --git a/drivers/media/dvb/dvb-usb/vp7045.c b/drivers/media/dvb/dvb-usb/vp7045.c index 028204956bb0..7fa656b108cc 100644 --- a/drivers/media/dvb/dvb-usb/vp7045.c +++ b/drivers/media/dvb/dvb-usb/vp7045.c | |||
@@ -38,7 +38,7 @@ int vp7045_usb_op(struct dvb_usb_device *d, u8 cmd, u8 *out, int outlen, u8 *in, | |||
38 | deb_xfer("out buffer: "); | 38 | deb_xfer("out buffer: "); |
39 | debug_dump(outbuf,outlen+1,deb_xfer); | 39 | debug_dump(outbuf,outlen+1,deb_xfer); |
40 | 40 | ||
41 | if ((ret = down_interruptible(&d->usb_sem))) | 41 | if ((ret = mutex_lock_interruptible(&d->usb_mutex))) |
42 | return ret; | 42 | return ret; |
43 | 43 | ||
44 | if (usb_control_msg(d->udev, | 44 | if (usb_control_msg(d->udev, |
@@ -68,7 +68,7 @@ int vp7045_usb_op(struct dvb_usb_device *d, u8 cmd, u8 *out, int outlen, u8 *in, | |||
68 | memcpy(in,&inbuf[1],inlen); | 68 | memcpy(in,&inbuf[1],inlen); |
69 | 69 | ||
70 | unlock: | 70 | unlock: |
71 | up(&d->usb_sem); | 71 | mutex_unlock(&d->usb_mutex); |
72 | 72 | ||
73 | return ret; | 73 | return ret; |
74 | } | 74 | } |