diff options
Diffstat (limited to 'drivers/media/dvb/frontends/bcm3510.c')
-rw-r--r-- | drivers/media/dvb/frontends/bcm3510.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/media/dvb/frontends/bcm3510.c b/drivers/media/dvb/frontends/bcm3510.c index caaee893ca76..1708a1d4893e 100644 --- a/drivers/media/dvb/frontends/bcm3510.c +++ b/drivers/media/dvb/frontends/bcm3510.c | |||
@@ -39,6 +39,7 @@ | |||
39 | #include <linux/jiffies.h> | 39 | #include <linux/jiffies.h> |
40 | #include <linux/string.h> | 40 | #include <linux/string.h> |
41 | #include <linux/slab.h> | 41 | #include <linux/slab.h> |
42 | #include <linux/mutex.h> | ||
42 | 43 | ||
43 | #include "dvb_frontend.h" | 44 | #include "dvb_frontend.h" |
44 | #include "bcm3510.h" | 45 | #include "bcm3510.h" |
@@ -52,7 +53,7 @@ struct bcm3510_state { | |||
52 | struct dvb_frontend frontend; | 53 | struct dvb_frontend frontend; |
53 | 54 | ||
54 | /* demodulator private data */ | 55 | /* demodulator private data */ |
55 | struct semaphore hab_sem; | 56 | struct mutex hab_mutex; |
56 | u8 firmware_loaded:1; | 57 | u8 firmware_loaded:1; |
57 | 58 | ||
58 | unsigned long next_status_check; | 59 | unsigned long next_status_check; |
@@ -213,7 +214,7 @@ static int bcm3510_do_hab_cmd(struct bcm3510_state *st, u8 cmd, u8 msgid, u8 *ob | |||
213 | dbufout(ob,olen+2,deb_hab); | 214 | dbufout(ob,olen+2,deb_hab); |
214 | deb_hab("\n"); | 215 | deb_hab("\n"); |
215 | 216 | ||
216 | if (down_interruptible(&st->hab_sem) < 0) | 217 | if (mutex_lock_interruptible(&st->hab_mutex) < 0) |
217 | return -EAGAIN; | 218 | return -EAGAIN; |
218 | 219 | ||
219 | if ((ret = bcm3510_hab_send_request(st, ob, olen+2)) < 0 || | 220 | if ((ret = bcm3510_hab_send_request(st, ob, olen+2)) < 0 || |
@@ -226,7 +227,7 @@ static int bcm3510_do_hab_cmd(struct bcm3510_state *st, u8 cmd, u8 msgid, u8 *ob | |||
226 | 227 | ||
227 | memcpy(ibuf,&ib[2],ilen); | 228 | memcpy(ibuf,&ib[2],ilen); |
228 | error: | 229 | error: |
229 | up(&st->hab_sem); | 230 | mutex_unlock(&st->hab_mutex); |
230 | return ret; | 231 | return ret; |
231 | } | 232 | } |
232 | 233 | ||
@@ -796,7 +797,7 @@ struct dvb_frontend* bcm3510_attach(const struct bcm3510_config *config, | |||
796 | state->frontend.ops = &state->ops; | 797 | state->frontend.ops = &state->ops; |
797 | state->frontend.demodulator_priv = state; | 798 | state->frontend.demodulator_priv = state; |
798 | 799 | ||
799 | sema_init(&state->hab_sem, 1); | 800 | mutex_init(&state->hab_mutex); |
800 | 801 | ||
801 | if ((ret = bcm3510_readB(state,0xe0,&v)) < 0) | 802 | if ((ret = bcm3510_readB(state,0xe0,&v)) < 0) |
802 | goto error; | 803 | goto error; |