diff options
Diffstat (limited to 'drivers/media/dvb/ttpci/av7110.c')
-rw-r--r-- | drivers/media/dvb/ttpci/av7110.c | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/drivers/media/dvb/ttpci/av7110.c b/drivers/media/dvb/ttpci/av7110.c index d36369e9e88f..1aa61bf29ad6 100644 --- a/drivers/media/dvb/ttpci/av7110.c +++ b/drivers/media/dvb/ttpci/av7110.c | |||
@@ -54,7 +54,6 @@ | |||
54 | #include <linux/i2c.h> | 54 | #include <linux/i2c.h> |
55 | 55 | ||
56 | #include <asm/system.h> | 56 | #include <asm/system.h> |
57 | #include <asm/semaphore.h> | ||
58 | 57 | ||
59 | #include <linux/dvb/frontend.h> | 58 | #include <linux/dvb/frontend.h> |
60 | 59 | ||
@@ -242,10 +241,10 @@ static int arm_thread(void *data) | |||
242 | if (!av7110->arm_ready) | 241 | if (!av7110->arm_ready) |
243 | continue; | 242 | continue; |
244 | 243 | ||
245 | if (down_interruptible(&av7110->dcomlock)) | 244 | if (mutex_lock_interruptible(&av7110->dcomlock)) |
246 | break; | 245 | break; |
247 | newloops = rdebi(av7110, DEBINOSWAP, STATUS_LOOPS, 0, 2); | 246 | newloops = rdebi(av7110, DEBINOSWAP, STATUS_LOOPS, 0, 2); |
248 | up(&av7110->dcomlock); | 247 | mutex_unlock(&av7110->dcomlock); |
249 | 248 | ||
250 | if (newloops == av7110->arm_loops || av7110->arm_errors > 3) { | 249 | if (newloops == av7110->arm_loops || av7110->arm_errors > 3) { |
251 | printk(KERN_ERR "dvb-ttpci: ARM crashed @ card %d\n", | 250 | printk(KERN_ERR "dvb-ttpci: ARM crashed @ card %d\n", |
@@ -253,10 +252,10 @@ static int arm_thread(void *data) | |||
253 | 252 | ||
254 | recover_arm(av7110); | 253 | recover_arm(av7110); |
255 | 254 | ||
256 | if (down_interruptible(&av7110->dcomlock)) | 255 | if (mutex_lock_interruptible(&av7110->dcomlock)) |
257 | break; | 256 | break; |
258 | newloops = rdebi(av7110, DEBINOSWAP, STATUS_LOOPS, 0, 2) - 1; | 257 | newloops = rdebi(av7110, DEBINOSWAP, STATUS_LOOPS, 0, 2) - 1; |
259 | up(&av7110->dcomlock); | 258 | mutex_unlock(&av7110->dcomlock); |
260 | } | 259 | } |
261 | av7110->arm_loops = newloops; | 260 | av7110->arm_loops = newloops; |
262 | av7110->arm_errors = 0; | 261 | av7110->arm_errors = 0; |
@@ -741,7 +740,7 @@ int ChangePIDs(struct av7110 *av7110, u16 vpid, u16 apid, u16 ttpid, | |||
741 | int ret = 0; | 740 | int ret = 0; |
742 | dprintk(4, "%p\n", av7110); | 741 | dprintk(4, "%p\n", av7110); |
743 | 742 | ||
744 | if (down_interruptible(&av7110->pid_mutex)) | 743 | if (mutex_lock_interruptible(&av7110->pid_mutex)) |
745 | return -ERESTARTSYS; | 744 | return -ERESTARTSYS; |
746 | 745 | ||
747 | if (!(vpid & 0x8000)) | 746 | if (!(vpid & 0x8000)) |
@@ -760,7 +759,7 @@ int ChangePIDs(struct av7110 *av7110, u16 vpid, u16 apid, u16 ttpid, | |||
760 | ret = SetPIDs(av7110, vpid, apid, ttpid, subpid, pcrpid); | 759 | ret = SetPIDs(av7110, vpid, apid, ttpid, subpid, pcrpid); |
761 | } | 760 | } |
762 | 761 | ||
763 | up(&av7110->pid_mutex); | 762 | mutex_unlock(&av7110->pid_mutex); |
764 | return ret; | 763 | return ret; |
765 | } | 764 | } |
766 | 765 | ||
@@ -2096,7 +2095,7 @@ static int av7110_fe_lock_fix(struct av7110* av7110, fe_status_t status) | |||
2096 | if (av7110->playing) | 2095 | if (av7110->playing) |
2097 | return 0; | 2096 | return 0; |
2098 | 2097 | ||
2099 | if (down_interruptible(&av7110->pid_mutex)) | 2098 | if (mutex_lock_interruptible(&av7110->pid_mutex)) |
2100 | return -ERESTARTSYS; | 2099 | return -ERESTARTSYS; |
2101 | 2100 | ||
2102 | if (synced) { | 2101 | if (synced) { |
@@ -2118,7 +2117,7 @@ static int av7110_fe_lock_fix(struct av7110* av7110, fe_status_t status) | |||
2118 | if (!ret) | 2117 | if (!ret) |
2119 | av7110->fe_synced = synced; | 2118 | av7110->fe_synced = synced; |
2120 | 2119 | ||
2121 | up(&av7110->pid_mutex); | 2120 | mutex_unlock(&av7110->pid_mutex); |
2122 | return ret; | 2121 | return ret; |
2123 | } | 2122 | } |
2124 | 2123 | ||
@@ -2713,16 +2712,16 @@ static int av7110_attach(struct saa7146_dev* dev, struct saa7146_pci_extension_d | |||
2713 | tasklet_init (&av7110->debi_tasklet, debiirq, (unsigned long) av7110); | 2712 | tasklet_init (&av7110->debi_tasklet, debiirq, (unsigned long) av7110); |
2714 | tasklet_init (&av7110->gpio_tasklet, gpioirq, (unsigned long) av7110); | 2713 | tasklet_init (&av7110->gpio_tasklet, gpioirq, (unsigned long) av7110); |
2715 | 2714 | ||
2716 | sema_init(&av7110->pid_mutex, 1); | 2715 | mutex_init(&av7110->pid_mutex); |
2717 | 2716 | ||
2718 | /* locks for data transfers from/to AV7110 */ | 2717 | /* locks for data transfers from/to AV7110 */ |
2719 | spin_lock_init(&av7110->debilock); | 2718 | spin_lock_init(&av7110->debilock); |
2720 | sema_init(&av7110->dcomlock, 1); | 2719 | mutex_init(&av7110->dcomlock); |
2721 | av7110->debitype = -1; | 2720 | av7110->debitype = -1; |
2722 | 2721 | ||
2723 | /* default OSD window */ | 2722 | /* default OSD window */ |
2724 | av7110->osdwin = 1; | 2723 | av7110->osdwin = 1; |
2725 | sema_init(&av7110->osd_sema, 1); | 2724 | mutex_init(&av7110->osd_mutex); |
2726 | 2725 | ||
2727 | /* ARM "watchdog" */ | 2726 | /* ARM "watchdog" */ |
2728 | init_waitqueue_head(&av7110->arm_wait); | 2727 | init_waitqueue_head(&av7110->arm_wait); |