aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/radio/radio-aimslab.c
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/radio/radio-aimslab.c
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/radio/radio-aimslab.c')
-rw-r--r--drivers/media/radio/radio-aimslab.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/drivers/media/radio/radio-aimslab.c b/drivers/media/radio/radio-aimslab.c
index 914deab4e044..557fb5c4af38 100644
--- a/drivers/media/radio/radio-aimslab.c
+++ b/drivers/media/radio/radio-aimslab.c
@@ -43,7 +43,7 @@
43 43
44static int io = CONFIG_RADIO_RTRACK_PORT; 44static int io = CONFIG_RADIO_RTRACK_PORT;
45static int radio_nr = -1; 45static int radio_nr = -1;
46static struct semaphore lock; 46static struct mutex lock;
47 47
48struct rt_device 48struct rt_device
49{ 49{
@@ -83,23 +83,23 @@ static void rt_incvol(void)
83static void rt_mute(struct rt_device *dev) 83static void rt_mute(struct rt_device *dev)
84{ 84{
85 dev->muted = 1; 85 dev->muted = 1;
86 down(&lock); 86 mutex_lock(&lock);
87 outb(0xd0, io); /* volume steady, off */ 87 outb(0xd0, io); /* volume steady, off */
88 up(&lock); 88 mutex_unlock(&lock);
89} 89}
90 90
91static int rt_setvol(struct rt_device *dev, int vol) 91static int rt_setvol(struct rt_device *dev, int vol)
92{ 92{
93 int i; 93 int i;
94 94
95 down(&lock); 95 mutex_lock(&lock);
96 96
97 if(vol == dev->curvol) { /* requested volume = current */ 97 if(vol == dev->curvol) { /* requested volume = current */
98 if (dev->muted) { /* user is unmuting the card */ 98 if (dev->muted) { /* user is unmuting the card */
99 dev->muted = 0; 99 dev->muted = 0;
100 outb (0xd8, io); /* enable card */ 100 outb (0xd8, io); /* enable card */
101 } 101 }
102 up(&lock); 102 mutex_unlock(&lock);
103 return 0; 103 return 0;
104 } 104 }
105 105
@@ -108,7 +108,7 @@ static int rt_setvol(struct rt_device *dev, int vol)
108 sleep_delay(2000000); /* make sure it's totally down */ 108 sleep_delay(2000000); /* make sure it's totally down */
109 outb(0xd0, io); /* volume steady, off */ 109 outb(0xd0, io); /* volume steady, off */
110 dev->curvol = 0; /* track the volume state! */ 110 dev->curvol = 0; /* track the volume state! */
111 up(&lock); 111 mutex_unlock(&lock);
112 return 0; 112 return 0;
113 } 113 }
114 114
@@ -121,7 +121,7 @@ static int rt_setvol(struct rt_device *dev, int vol)
121 rt_decvol(); 121 rt_decvol();
122 122
123 dev->curvol = vol; 123 dev->curvol = vol;
124 up(&lock); 124 mutex_unlock(&lock);
125 return 0; 125 return 0;
126} 126}
127 127
@@ -168,7 +168,7 @@ static int rt_setfreq(struct rt_device *dev, unsigned long freq)
168 freq += 171200; /* Add 10.7 MHz IF */ 168 freq += 171200; /* Add 10.7 MHz IF */
169 freq /= 800; /* Convert to 50 kHz units */ 169 freq /= 800; /* Convert to 50 kHz units */
170 170
171 down(&lock); /* Stop other ops interfering */ 171 mutex_lock(&lock); /* Stop other ops interfering */
172 172
173 send_0_byte (io, dev); /* 0: LSB of frequency */ 173 send_0_byte (io, dev); /* 0: LSB of frequency */
174 174
@@ -196,7 +196,7 @@ static int rt_setfreq(struct rt_device *dev, unsigned long freq)
196 else 196 else
197 outb (0xd8, io); /* volume steady + sigstr + on */ 197 outb (0xd8, io); /* volume steady + sigstr + on */
198 198
199 up(&lock); 199 mutex_unlock(&lock);
200 200
201 return 0; 201 return 0;
202} 202}
@@ -337,7 +337,7 @@ static int __init rtrack_init(void)
337 337
338 /* Set up the I/O locking */ 338 /* Set up the I/O locking */
339 339
340 init_MUTEX(&lock); 340 mutex_init(&lock);
341 341
342 /* mute card - prevents noisy bootups */ 342 /* mute card - prevents noisy bootups */
343 343