aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb/bt8xx
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2006-02-07 03:49:14 -0500
committerMauro Carvalho Chehab <mchehab@infradead.org>2006-02-07 03:49:14 -0500
commit3593cab5d62c4c7abced1076710f9bc2d8847433 (patch)
treedd5dc21961f6b4aef6900b0c2eb63ce7c70aecd5 /drivers/media/dvb/bt8xx
parent538f9630afbbe429ecbcdcf92536200293a8e4b3 (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/bt8xx')
-rw-r--r--drivers/media/dvb/bt8xx/bt878.c4
-rw-r--r--drivers/media/dvb/bt8xx/bt878.h4
-rw-r--r--drivers/media/dvb/bt8xx/dst.c14
-rw-r--r--drivers/media/dvb/bt8xx/dst_ca.c6
-rw-r--r--drivers/media/dvb/bt8xx/dst_common.h3
-rw-r--r--drivers/media/dvb/bt8xx/dvb-bt8xx.c12
-rw-r--r--drivers/media/dvb/bt8xx/dvb-bt8xx.h3
7 files changed, 25 insertions, 21 deletions
diff --git a/drivers/media/dvb/bt8xx/bt878.c b/drivers/media/dvb/bt8xx/bt878.c
index 34c3189a1a3..d276ce6b366 100644
--- a/drivers/media/dvb/bt8xx/bt878.c
+++ b/drivers/media/dvb/bt8xx/bt878.c
@@ -344,7 +344,7 @@ bt878_device_control(struct bt878 *bt, unsigned int cmd, union dst_gpio_packet *
344 int retval; 344 int retval;
345 345
346 retval = 0; 346 retval = 0;
347 if (down_interruptible (&bt->gpio_lock)) 347 if (mutex_lock_interruptible(&bt->gpio_lock))
348 return -ERESTARTSYS; 348 return -ERESTARTSYS;
349 /* special gpio signal */ 349 /* special gpio signal */
350 switch (cmd) { 350 switch (cmd) {
@@ -375,7 +375,7 @@ bt878_device_control(struct bt878 *bt, unsigned int cmd, union dst_gpio_packet *
375 retval = -EINVAL; 375 retval = -EINVAL;
376 break; 376 break;
377 } 377 }
378 up(&bt->gpio_lock); 378 mutex_unlock(&bt->gpio_lock);
379 return retval; 379 return retval;
380} 380}
381 381
diff --git a/drivers/media/dvb/bt8xx/bt878.h b/drivers/media/dvb/bt8xx/bt878.h
index 9faf93770d0..f685bc12960 100644
--- a/drivers/media/dvb/bt8xx/bt878.h
+++ b/drivers/media/dvb/bt8xx/bt878.h
@@ -25,6 +25,8 @@
25#include <linux/pci.h> 25#include <linux/pci.h>
26#include <linux/sched.h> 26#include <linux/sched.h>
27#include <linux/spinlock.h> 27#include <linux/spinlock.h>
28#include <linux/mutex.h>
29
28#include "bt848.h" 30#include "bt848.h"
29#include "bttv.h" 31#include "bttv.h"
30 32
@@ -108,7 +110,7 @@ struct cards {
108extern int bt878_num; 110extern int bt878_num;
109 111
110struct bt878 { 112struct bt878 {
111 struct semaphore gpio_lock; 113 struct mutex gpio_lock;
112 unsigned int nr; 114 unsigned int nr;
113 unsigned int bttv_nr; 115 unsigned int bttv_nr;
114 struct i2c_adapter *adapter; 116 struct i2c_adapter *adapter;
diff --git a/drivers/media/dvb/bt8xx/dst.c b/drivers/media/dvb/bt8xx/dst.c
index 3a2ff1cc24b..d800df1212c 100644
--- a/drivers/media/dvb/bt8xx/dst.c
+++ b/drivers/media/dvb/bt8xx/dst.c
@@ -910,7 +910,7 @@ static int dst_get_device_id(struct dst_state *state)
910 910
911static int dst_probe(struct dst_state *state) 911static int dst_probe(struct dst_state *state)
912{ 912{
913 sema_init(&state->dst_mutex, 1); 913 mutex_init(&state->dst_mutex);
914 if ((rdc_8820_reset(state)) < 0) { 914 if ((rdc_8820_reset(state)) < 0) {
915 dprintk(verbose, DST_ERROR, 1, "RDC 8820 RESET Failed."); 915 dprintk(verbose, DST_ERROR, 1, "RDC 8820 RESET Failed.");
916 return -1; 916 return -1;
@@ -962,7 +962,7 @@ int dst_command(struct dst_state *state, u8 *data, u8 len)
962{ 962{
963 u8 reply; 963 u8 reply;
964 964
965 down(&state->dst_mutex); 965 mutex_lock(&state->dst_mutex);
966 if ((dst_comm_init(state)) < 0) { 966 if ((dst_comm_init(state)) < 0) {
967 dprintk(verbose, DST_NOTICE, 1, "DST Communication Initialization Failed."); 967 dprintk(verbose, DST_NOTICE, 1, "DST Communication Initialization Failed.");
968 goto error; 968 goto error;
@@ -1013,11 +1013,11 @@ int dst_command(struct dst_state *state, u8 *data, u8 len)
1013 dprintk(verbose, DST_INFO, 1, "checksum failure"); 1013 dprintk(verbose, DST_INFO, 1, "checksum failure");
1014 goto error; 1014 goto error;
1015 } 1015 }
1016 up(&state->dst_mutex); 1016 mutex_unlock(&state->dst_mutex);
1017 return 0; 1017 return 0;
1018 1018
1019error: 1019error:
1020 up(&state->dst_mutex); 1020 mutex_unlock(&state->dst_mutex);
1021 return -EIO; 1021 return -EIO;
1022 1022
1023} 1023}
@@ -1128,7 +1128,7 @@ static int dst_write_tuna(struct dvb_frontend *fe)
1128 dst_set_voltage(fe, SEC_VOLTAGE_13); 1128 dst_set_voltage(fe, SEC_VOLTAGE_13);
1129 } 1129 }
1130 state->diseq_flags &= ~(HAS_LOCK | ATTEMPT_TUNE); 1130 state->diseq_flags &= ~(HAS_LOCK | ATTEMPT_TUNE);
1131 down(&state->dst_mutex); 1131 mutex_lock(&state->dst_mutex);
1132 if ((dst_comm_init(state)) < 0) { 1132 if ((dst_comm_init(state)) < 0) {
1133 dprintk(verbose, DST_DEBUG, 1, "DST Communication initialization failed."); 1133 dprintk(verbose, DST_DEBUG, 1, "DST Communication initialization failed.");
1134 goto error; 1134 goto error;
@@ -1160,11 +1160,11 @@ static int dst_write_tuna(struct dvb_frontend *fe)
1160 state->diseq_flags |= ATTEMPT_TUNE; 1160 state->diseq_flags |= ATTEMPT_TUNE;
1161 retval = dst_get_tuna(state); 1161 retval = dst_get_tuna(state);
1162werr: 1162werr:
1163 up(&state->dst_mutex); 1163 mutex_unlock(&state->dst_mutex);
1164 return retval; 1164 return retval;
1165 1165
1166error: 1166error:
1167 up(&state->dst_mutex); 1167 mutex_unlock(&state->dst_mutex);
1168 return -EIO; 1168 return -EIO;
1169} 1169}
1170 1170
diff --git a/drivers/media/dvb/bt8xx/dst_ca.c b/drivers/media/dvb/bt8xx/dst_ca.c
index c650b4bf7f5..f6b49a801eb 100644
--- a/drivers/media/dvb/bt8xx/dst_ca.c
+++ b/drivers/media/dvb/bt8xx/dst_ca.c
@@ -81,7 +81,7 @@ static int dst_ci_command(struct dst_state* state, u8 * data, u8 *ca_string, u8
81{ 81{
82 u8 reply; 82 u8 reply;
83 83
84 down(&state->dst_mutex); 84 mutex_lock(&state->dst_mutex);
85 dst_comm_init(state); 85 dst_comm_init(state);
86 msleep(65); 86 msleep(65);
87 87
@@ -110,11 +110,11 @@ static int dst_ci_command(struct dst_state* state, u8 * data, u8 *ca_string, u8
110 goto error; 110 goto error;
111 } 111 }
112 } 112 }
113 up(&state->dst_mutex); 113 mutex_unlock(&state->dst_mutex);
114 return 0; 114 return 0;
115 115
116error: 116error:
117 up(&state->dst_mutex); 117 mutex_unlock(&state->dst_mutex);
118 return -EIO; 118 return -EIO;
119} 119}
120 120
diff --git a/drivers/media/dvb/bt8xx/dst_common.h b/drivers/media/dvb/bt8xx/dst_common.h
index 81557f38fe3..51d4e043716 100644
--- a/drivers/media/dvb/bt8xx/dst_common.h
+++ b/drivers/media/dvb/bt8xx/dst_common.h
@@ -25,6 +25,7 @@
25#include <linux/smp_lock.h> 25#include <linux/smp_lock.h>
26#include <linux/dvb/frontend.h> 26#include <linux/dvb/frontend.h>
27#include <linux/device.h> 27#include <linux/device.h>
28#include <linux/mutex.h>
28#include "bt878.h" 29#include "bt878.h"
29 30
30#include "dst_ca.h" 31#include "dst_ca.h"
@@ -121,7 +122,7 @@ struct dst_state {
121 u8 vendor[8]; 122 u8 vendor[8];
122 u8 board_info[8]; 123 u8 board_info[8];
123 124
124 struct semaphore dst_mutex; 125 struct mutex dst_mutex;
125}; 126};
126 127
127struct dst_types { 128struct dst_types {
diff --git a/drivers/media/dvb/bt8xx/dvb-bt8xx.c b/drivers/media/dvb/bt8xx/dvb-bt8xx.c
index ea27b15007e..1649846f9ce 100644
--- a/drivers/media/dvb/bt8xx/dvb-bt8xx.c
+++ b/drivers/media/dvb/bt8xx/dvb-bt8xx.c
@@ -76,13 +76,13 @@ static int dvb_bt8xx_start_feed(struct dvb_demux_feed *dvbdmxfeed)
76 if (!dvbdmx->dmx.frontend) 76 if (!dvbdmx->dmx.frontend)
77 return -EINVAL; 77 return -EINVAL;
78 78
79 down(&card->lock); 79 mutex_lock(&card->lock);
80 card->nfeeds++; 80 card->nfeeds++;
81 rc = card->nfeeds; 81 rc = card->nfeeds;
82 if (card->nfeeds == 1) 82 if (card->nfeeds == 1)
83 bt878_start(card->bt, card->gpio_mode, 83 bt878_start(card->bt, card->gpio_mode,
84 card->op_sync_orin, card->irq_err_ignore); 84 card->op_sync_orin, card->irq_err_ignore);
85 up(&card->lock); 85 mutex_unlock(&card->lock);
86 return rc; 86 return rc;
87} 87}
88 88
@@ -96,11 +96,11 @@ static int dvb_bt8xx_stop_feed(struct dvb_demux_feed *dvbdmxfeed)
96 if (!dvbdmx->dmx.frontend) 96 if (!dvbdmx->dmx.frontend)
97 return -EINVAL; 97 return -EINVAL;
98 98
99 down(&card->lock); 99 mutex_lock(&card->lock);
100 card->nfeeds--; 100 card->nfeeds--;
101 if (card->nfeeds == 0) 101 if (card->nfeeds == 0)
102 bt878_stop(card->bt); 102 bt878_stop(card->bt);
103 up(&card->lock); 103 mutex_unlock(&card->lock);
104 104
105 return 0; 105 return 0;
106} 106}
@@ -788,7 +788,7 @@ static int dvb_bt8xx_probe(struct bttv_sub_device *sub)
788 if (!(card = kzalloc(sizeof(struct dvb_bt8xx_card), GFP_KERNEL))) 788 if (!(card = kzalloc(sizeof(struct dvb_bt8xx_card), GFP_KERNEL)))
789 return -ENOMEM; 789 return -ENOMEM;
790 790
791 init_MUTEX(&card->lock); 791 mutex_init(&card->lock);
792 card->bttv_nr = sub->core->nr; 792 card->bttv_nr = sub->core->nr;
793 strncpy(card->card_name, sub->core->name, sizeof(sub->core->name)); 793 strncpy(card->card_name, sub->core->name, sizeof(sub->core->name));
794 card->i2c_adapter = &sub->core->i2c_adap; 794 card->i2c_adapter = &sub->core->i2c_adap;
@@ -881,7 +881,7 @@ static int dvb_bt8xx_probe(struct bttv_sub_device *sub)
881 return -EFAULT; 881 return -EFAULT;
882 } 882 }
883 883
884 init_MUTEX(&card->bt->gpio_lock); 884 mutex_init(&card->bt->gpio_lock);
885 card->bt->bttv_nr = sub->core->nr; 885 card->bt->bttv_nr = sub->core->nr;
886 886
887 if ( (ret = dvb_bt8xx_load_card(card, sub->core->type)) ) { 887 if ( (ret = dvb_bt8xx_load_card(card, sub->core->type)) ) {
diff --git a/drivers/media/dvb/bt8xx/dvb-bt8xx.h b/drivers/media/dvb/bt8xx/dvb-bt8xx.h
index cf035a80361..00dd9fa54c8 100644
--- a/drivers/media/dvb/bt8xx/dvb-bt8xx.h
+++ b/drivers/media/dvb/bt8xx/dvb-bt8xx.h
@@ -26,6 +26,7 @@
26#define DVB_BT8XX_H 26#define DVB_BT8XX_H
27 27
28#include <linux/i2c.h> 28#include <linux/i2c.h>
29#include <linux/mutex.h>
29#include "dvbdev.h" 30#include "dvbdev.h"
30#include "dvb_net.h" 31#include "dvb_net.h"
31#include "bttv.h" 32#include "bttv.h"
@@ -38,7 +39,7 @@
38#include "lgdt330x.h" 39#include "lgdt330x.h"
39 40
40struct dvb_bt8xx_card { 41struct dvb_bt8xx_card {
41 struct semaphore lock; 42 struct mutex lock;
42 int nfeeds; 43 int nfeeds;
43 char card_name[32]; 44 char card_name[32];
44 struct dvb_adapter dvb_adapter; 45 struct dvb_adapter dvb_adapter;