diff options
author | Mauro Carvalho Chehab <devnull@localhost> | 2006-01-15 09:52:23 +0000 |
---|---|---|
committer | Mauro Carvalho Chehab <devnull@localhost> | 2006-01-15 09:52:23 +0000 |
commit | 12c8d4bd89de115b407917fa0afcadd53729396c (patch) | |
tree | 2138cc6008c41c35fe01105ef1e5dd1681beff20 /linux/drivers/media/video/cx88 | |
parent | 4f37f2dabb3c3ef9675c7e9b3980aa9da78e4754 (diff) | |
download | mediapointer-dvb-s2-12c8d4bd89de115b407917fa0afcadd53729396c.tar.gz mediapointer-dvb-s2-12c8d4bd89de115b407917fa0afcadd53729396c.tar.bz2 |
Semaphore to mutex conversion on drivers/media
From: Ingo Molnar <mingo@elte.hu>
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 'linux/drivers/media/video/cx88')
-rw-r--r-- | linux/drivers/media/video/cx88/cx88-core.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/linux/drivers/media/video/cx88/cx88-core.c b/linux/drivers/media/video/cx88/cx88-core.c index f2e18b89d..93186a4df 100644 --- a/linux/drivers/media/video/cx88/cx88-core.c +++ b/linux/drivers/media/video/cx88/cx88-core.c @@ -1,5 +1,5 @@ /* - * $Id: cx88-core.c,v 1.53 2006/01/11 19:28:02 mchehab Exp $ + * $Id: cx88-core.c,v 1.54 2006/01/15 09:52:23 mchehab Exp $ * * device driver for Conexant 2388x based TV cards * driver core @@ -34,6 +34,9 @@ #include <linux/delay.h> #include "compat.h" #include <linux/videodev2.h> +#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,15) +#include <linux/mutex.h> +#endif #include "cx88.h" #include <media/v4l2-common.h> @@ -90,7 +93,7 @@ MODULE_PARM_DESC(nocomb,"disable comb filter"); static unsigned int cx88_devcount; static LIST_HEAD(cx88_devlist); -static DECLARE_MUTEX(devlist); +static DEFINE_MUTEX(devlist); #define NO_SYNC_LINE (-1U) @@ -1081,7 +1084,7 @@ struct cx88_core* cx88_core_get(struct pci_dev *pci) struct list_head *item; int i; - down(&devlist); + mutex_lock(&devlist); list_for_each(item,&cx88_devlist) { core = list_entry(item, struct cx88_core, devlist); if (pci->bus->number != core->pci_bus) @@ -1092,7 +1095,7 @@ struct cx88_core* cx88_core_get(struct pci_dev *pci) if (0 != get_ressources(core,pci)) goto fail_unlock; atomic_inc(&core->refcount); - up(&devlist); + mutex_unlock(&devlist); return core; } core = kzalloc(sizeof(*core),GFP_KERNEL); @@ -1167,13 +1170,13 @@ struct cx88_core* cx88_core_get(struct pci_dev *pci) cx88_card_setup(core); cx88_ir_init(core,pci); - up(&devlist); + mutex_unlock(&devlist); return core; fail_free: kfree(core); fail_unlock: - up(&devlist); + mutex_unlock(&devlist); return NULL; } @@ -1185,14 +1188,14 @@ void cx88_core_put(struct cx88_core *core, struct pci_dev *pci) if (!atomic_dec_and_test(&core->refcount)) return; - down(&devlist); + mutex_lock(&devlist); cx88_ir_fini(core); if (0 == core->i2c_rc) i2c_bit_del_bus(&core->i2c_adap); list_del(&core->devlist); iounmap(core->lmmio); cx88_devcount--; - up(&devlist); + mutex_unlock(&devlist); kfree(core); } |