From 12c8d4bd89de115b407917fa0afcadd53729396c Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Sun, 15 Jan 2006 09:52:23 +0000 Subject: Semaphore to mutex conversion on drivers/media From: Ingo Molnar 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 Signed-off-by: Andrew Morton Signed-off-by: Mauro Carvalho Chehab --- linux/drivers/media/video/cx88/cx88-core.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'linux/drivers/media/video/cx88') 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 #include "compat.h" #include +#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,15) +#include +#endif #include "cx88.h" #include @@ -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); } -- cgit v1.2.3