aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/radio/miropcm20-rds-core.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/radio/miropcm20-rds-core.c')
-rw-r--r--drivers/media/radio/miropcm20-rds-core.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/media/radio/miropcm20-rds-core.c b/drivers/media/radio/miropcm20-rds-core.c
index a917a90cb5dc..b602c73e2309 100644
--- a/drivers/media/radio/miropcm20-rds-core.c
+++ b/drivers/media/radio/miropcm20-rds-core.c
@@ -18,14 +18,15 @@
18#include <linux/string.h> 18#include <linux/string.h>
19#include <linux/init.h> 19#include <linux/init.h>
20#include <linux/slab.h> 20#include <linux/slab.h>
21#include <asm/semaphore.h> 21#include <linux/mutex.h>
22
22#include <asm/io.h> 23#include <asm/io.h>
23#include "../../../sound/oss/aci.h" 24#include "../../../sound/oss/aci.h"
24#include "miropcm20-rds-core.h" 25#include "miropcm20-rds-core.h"
25 26
26#define DEBUG 0 27#define DEBUG 0
27 28
28static struct semaphore aci_rds_sem; 29static struct mutex aci_rds_mutex;
29 30
30#define RDS_DATASHIFT 2 /* Bit 2 */ 31#define RDS_DATASHIFT 2 /* Bit 2 */
31#define RDS_DATAMASK (1 << RDS_DATASHIFT) 32#define RDS_DATAMASK (1 << RDS_DATASHIFT)
@@ -181,7 +182,7 @@ int aci_rds_cmd(unsigned char cmd, unsigned char databuffer[], int datasize)
181{ 182{
182 int ret; 183 int ret;
183 184
184 if (down_interruptible(&aci_rds_sem)) 185 if (mutex_lock_interruptible(&aci_rds_mutex))
185 return -EINTR; 186 return -EINTR;
186 187
187 rds_write(cmd); 188 rds_write(cmd);
@@ -192,7 +193,7 @@ int aci_rds_cmd(unsigned char cmd, unsigned char databuffer[], int datasize)
192 else 193 else
193 ret = 0; 194 ret = 0;
194 195
195 up(&aci_rds_sem); 196 mutex_unlock(&aci_rds_mutex);
196 197
197 return ret; 198 return ret;
198} 199}
@@ -200,7 +201,7 @@ EXPORT_SYMBOL(aci_rds_cmd);
200 201
201int __init attach_aci_rds(void) 202int __init attach_aci_rds(void)
202{ 203{
203 init_MUTEX(&aci_rds_sem); 204 mutex_init(&aci_rds_mutex);
204 return 0; 205 return 0;
205} 206}
206 207