From 3593cab5d62c4c7abced1076710f9bc2d8847433 Mon Sep 17 00:00:00 2001 From: Ingo Molnar Date: Tue, 7 Feb 2006 06:49:14 -0200 Subject: 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 Signed-off-by: Andrew Morton Signed-off-by: Mauro Carvalho Chehab --- drivers/media/radio/radio-typhoon.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'drivers/media/radio/radio-typhoon.c') 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 { int muted; unsigned long curfreq; unsigned long mutefreq; - struct semaphore lock; + struct mutex lock; }; static 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); static void typhoon_setvol_generic(struct typhoon_device *dev, int vol) { - down(&dev->lock); + mutex_lock(&dev->lock); vol >>= 14; /* Map 16 bit to 2 bit */ vol &= 3; outb_p(vol / 2, dev->iobase); /* Set the volume, high bit. */ outb_p(vol % 2, dev->iobase + 2); /* Set the volume, low bit. */ - up(&dev->lock); + mutex_unlock(&dev->lock); } static int typhoon_setfreq_generic(struct typhoon_device *dev, @@ -102,7 +102,7 @@ static int typhoon_setfreq_generic(struct typhoon_device *dev, * */ - down(&dev->lock); + mutex_lock(&dev->lock); x = frequency / 160; outval = (x * x + 2500) / 5000; outval = (outval * x + 5000) / 10000; @@ -112,7 +112,7 @@ static int typhoon_setfreq_generic(struct typhoon_device *dev, outb_p((outval >> 8) & 0x01, dev->iobase + 4); outb_p(outval >> 9, dev->iobase + 6); outb_p(outval & 0xff, dev->iobase + 8); - up(&dev->lock); + mutex_unlock(&dev->lock); return 0; } @@ -337,7 +337,7 @@ static int __init typhoon_init(void) #endif /* MODULE */ printk(KERN_INFO BANNER); - init_MUTEX(&typhoon_unit.lock); + mutex_init(&typhoon_unit.lock); io = typhoon_unit.iobase; if (!request_region(io, 8, "typhoon")) { printk(KERN_ERR "radio-typhoon: port 0x%x already in use\n", -- cgit v1.2.3