diff options
Diffstat (limited to 'drivers/media/dvb')
-rw-r--r-- | drivers/media/dvb/dvb-core/dvbdev.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/drivers/media/dvb/dvb-core/dvbdev.c b/drivers/media/dvb/dvb-core/dvbdev.c index 06b696e9acbd..54f8b95717b0 100644 --- a/drivers/media/dvb/dvb-core/dvbdev.c +++ b/drivers/media/dvb/dvb-core/dvbdev.c | |||
@@ -33,7 +33,7 @@ | |||
33 | #include <linux/device.h> | 33 | #include <linux/device.h> |
34 | #include <linux/fs.h> | 34 | #include <linux/fs.h> |
35 | #include <linux/cdev.h> | 35 | #include <linux/cdev.h> |
36 | 36 | #include <linux/mutex.h> | |
37 | #include "dvbdev.h" | 37 | #include "dvbdev.h" |
38 | 38 | ||
39 | static int dvbdev_debug; | 39 | static int dvbdev_debug; |
@@ -44,7 +44,7 @@ MODULE_PARM_DESC(dvbdev_debug, "Turn on/off device debugging (default:off)."); | |||
44 | #define dprintk if (dvbdev_debug) printk | 44 | #define dprintk if (dvbdev_debug) printk |
45 | 45 | ||
46 | static LIST_HEAD(dvb_adapter_list); | 46 | static LIST_HEAD(dvb_adapter_list); |
47 | static DECLARE_MUTEX(dvbdev_register_lock); | 47 | static DEFINE_MUTEX(dvbdev_register_lock); |
48 | 48 | ||
49 | static const char * const dnames[] = { | 49 | static const char * const dnames[] = { |
50 | "video", "audio", "sec", "frontend", "demux", "dvr", "ca", | 50 | "video", "audio", "sec", "frontend", "demux", "dvr", "ca", |
@@ -202,11 +202,11 @@ int dvb_register_device(struct dvb_adapter *adap, struct dvb_device **pdvbdev, | |||
202 | struct dvb_device *dvbdev; | 202 | struct dvb_device *dvbdev; |
203 | int id; | 203 | int id; |
204 | 204 | ||
205 | if (down_interruptible (&dvbdev_register_lock)) | 205 | if (mutex_lock_interruptible(&dvbdev_register_lock)) |
206 | return -ERESTARTSYS; | 206 | return -ERESTARTSYS; |
207 | 207 | ||
208 | if ((id = dvbdev_get_free_id (adap, type)) < 0) { | 208 | if ((id = dvbdev_get_free_id (adap, type)) < 0) { |
209 | up (&dvbdev_register_lock); | 209 | mutex_unlock(&dvbdev_register_lock); |
210 | *pdvbdev = NULL; | 210 | *pdvbdev = NULL; |
211 | printk ("%s: could get find free device id...\n", __FUNCTION__); | 211 | printk ("%s: could get find free device id...\n", __FUNCTION__); |
212 | return -ENFILE; | 212 | return -ENFILE; |
@@ -215,11 +215,11 @@ int dvb_register_device(struct dvb_adapter *adap, struct dvb_device **pdvbdev, | |||
215 | *pdvbdev = dvbdev = kmalloc(sizeof(struct dvb_device), GFP_KERNEL); | 215 | *pdvbdev = dvbdev = kmalloc(sizeof(struct dvb_device), GFP_KERNEL); |
216 | 216 | ||
217 | if (!dvbdev) { | 217 | if (!dvbdev) { |
218 | up(&dvbdev_register_lock); | 218 | mutex_unlock(&dvbdev_register_lock); |
219 | return -ENOMEM; | 219 | return -ENOMEM; |
220 | } | 220 | } |
221 | 221 | ||
222 | up (&dvbdev_register_lock); | 222 | mutex_unlock(&dvbdev_register_lock); |
223 | 223 | ||
224 | memcpy(dvbdev, template, sizeof(struct dvb_device)); | 224 | memcpy(dvbdev, template, sizeof(struct dvb_device)); |
225 | dvbdev->type = type; | 225 | dvbdev->type = type; |
@@ -289,11 +289,11 @@ int dvb_register_adapter(struct dvb_adapter *adap, const char *name, struct modu | |||
289 | { | 289 | { |
290 | int num; | 290 | int num; |
291 | 291 | ||
292 | if (down_interruptible (&dvbdev_register_lock)) | 292 | if (mutex_lock_interruptible(&dvbdev_register_lock)) |
293 | return -ERESTARTSYS; | 293 | return -ERESTARTSYS; |
294 | 294 | ||
295 | if ((num = dvbdev_get_free_adapter_num ()) < 0) { | 295 | if ((num = dvbdev_get_free_adapter_num ()) < 0) { |
296 | up (&dvbdev_register_lock); | 296 | mutex_unlock(&dvbdev_register_lock); |
297 | return -ENFILE; | 297 | return -ENFILE; |
298 | } | 298 | } |
299 | 299 | ||
@@ -309,7 +309,7 @@ int dvb_register_adapter(struct dvb_adapter *adap, const char *name, struct modu | |||
309 | 309 | ||
310 | list_add_tail (&adap->list_head, &dvb_adapter_list); | 310 | list_add_tail (&adap->list_head, &dvb_adapter_list); |
311 | 311 | ||
312 | up (&dvbdev_register_lock); | 312 | mutex_unlock(&dvbdev_register_lock); |
313 | 313 | ||
314 | return num; | 314 | return num; |
315 | } | 315 | } |
@@ -320,10 +320,10 @@ int dvb_unregister_adapter(struct dvb_adapter *adap) | |||
320 | { | 320 | { |
321 | devfs_remove("dvb/adapter%d", adap->num); | 321 | devfs_remove("dvb/adapter%d", adap->num); |
322 | 322 | ||
323 | if (down_interruptible (&dvbdev_register_lock)) | 323 | if (mutex_lock_interruptible(&dvbdev_register_lock)) |
324 | return -ERESTARTSYS; | 324 | return -ERESTARTSYS; |
325 | list_del (&adap->list_head); | 325 | list_del (&adap->list_head); |
326 | up (&dvbdev_register_lock); | 326 | mutex_unlock(&dvbdev_register_lock); |
327 | return 0; | 327 | return 0; |
328 | } | 328 | } |
329 | EXPORT_SYMBOL(dvb_unregister_adapter); | 329 | EXPORT_SYMBOL(dvb_unregister_adapter); |