aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/radio/radio-typhoon.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-typhoon.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-typhoon.c')
-rw-r--r--drivers/media/radio/radio-typhoon.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/media/radio/radio-typhoon.c b/drivers/media/radio/radio-typhoon.c
index 8ac9a8ef9094..e50955836d6b 100644
--- a/drivers/media/radio/radio-typhoon.c
+++ b/drivers/media/radio/radio-typhoon.c
@@ -59,7 +59,7 @@ struct typhoon_device {
59 int muted; 59 int muted;
60 unsigned long curfreq; 60 unsigned long curfreq;
61 unsigned long mutefreq; 61 unsigned long mutefreq;
62 struct semaphore lock; 62 struct mutex lock;
63}; 63};
64 64
65static void typhoon_setvol_generic(struct typhoon_device *dev, int vol); 65static void typhoon_setvol_generic(struct typhoon_device *dev, int vol);
@@ -77,12 +77,12 @@ static int typhoon_get_info(char *buf, char **start, off_t offset, int len);
77 77
78static void typhoon_setvol_generic(struct typhoon_device *dev, int vol) 78static void typhoon_setvol_generic(struct typhoon_device *dev, int vol)
79{ 79{
80 down(&dev->lock); 80 mutex_lock(&dev->lock);
81 vol >>= 14; /* Map 16 bit to 2 bit */ 81 vol >>= 14; /* Map 16 bit to 2 bit */
82 vol &= 3; 82 vol &= 3;
83 outb_p(vol / 2, dev->iobase); /* Set the volume, high bit. */ 83 outb_p(vol / 2, dev->iobase); /* Set the volume, high bit. */
84 outb_p(vol % 2, dev->iobase + 2); /* Set the volume, low bit. */ 84 outb_p(vol % 2, dev->iobase + 2); /* Set the volume, low bit. */
85 up(&dev->lock); 85 mutex_unlock(&dev->lock);
86} 86}
87 87
88static int typhoon_setfreq_generic(struct typhoon_device *dev, 88static int typhoon_setfreq_generic(struct typhoon_device *dev,
@@ -102,7 +102,7 @@ static int typhoon_setfreq_generic(struct typhoon_device *dev,
102 * 102 *
103 */ 103 */
104 104
105 down(&dev->lock); 105 mutex_lock(&dev->lock);
106 x = frequency / 160; 106 x = frequency / 160;
107 outval = (x * x + 2500) / 5000; 107 outval = (x * x + 2500) / 5000;
108 outval = (outval * x + 5000) / 10000; 108 outval = (outval * x + 5000) / 10000;
@@ -112,7 +112,7 @@ static int typhoon_setfreq_generic(struct typhoon_device *dev,
112 outb_p((outval >> 8) & 0x01, dev->iobase + 4); 112 outb_p((outval >> 8) & 0x01, dev->iobase + 4);
113 outb_p(outval >> 9, dev->iobase + 6); 113 outb_p(outval >> 9, dev->iobase + 6);
114 outb_p(outval & 0xff, dev->iobase + 8); 114 outb_p(outval & 0xff, dev->iobase + 8);
115 up(&dev->lock); 115 mutex_unlock(&dev->lock);
116 116
117 return 0; 117 return 0;
118} 118}
@@ -337,7 +337,7 @@ static int __init typhoon_init(void)
337#endif /* MODULE */ 337#endif /* MODULE */
338 338
339 printk(KERN_INFO BANNER); 339 printk(KERN_INFO BANNER);
340 init_MUTEX(&typhoon_unit.lock); 340 mutex_init(&typhoon_unit.lock);
341 io = typhoon_unit.iobase; 341 io = typhoon_unit.iobase;
342 if (!request_region(io, 8, "typhoon")) { 342 if (!request_region(io, 8, "typhoon")) {
343 printk(KERN_ERR "radio-typhoon: port 0x%x already in use\n", 343 printk(KERN_ERR "radio-typhoon: port 0x%x already in use\n",