X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=drivers%2Fmedia%2Fradio%2Fradio-aimslab.c;h=914deab4e04440c462e28a28998ff2c8c2e92141;hb=987b0145d94eecf292d8b301228356f44611ab7c;hp=557fb5c4af38ea59c5fad2cc3ae80cc29e125760;hpb=f7ed79d23a47594e7834d66a8f14449796d4f3e6;p=linux-2.6.git diff --git a/drivers/media/radio/radio-aimslab.c b/drivers/media/radio/radio-aimslab.c index 557fb5c4a..914deab4e 100644 --- a/drivers/media/radio/radio-aimslab.c +++ b/drivers/media/radio/radio-aimslab.c @@ -43,7 +43,7 @@ static int io = CONFIG_RADIO_RTRACK_PORT; static int radio_nr = -1; -static struct mutex lock; +static struct semaphore lock; struct rt_device { @@ -83,23 +83,23 @@ static void rt_incvol(void) static void rt_mute(struct rt_device *dev) { dev->muted = 1; - mutex_lock(&lock); + down(&lock); outb(0xd0, io); /* volume steady, off */ - mutex_unlock(&lock); + up(&lock); } static int rt_setvol(struct rt_device *dev, int vol) { int i; - mutex_lock(&lock); + down(&lock); if(vol == dev->curvol) { /* requested volume = current */ if (dev->muted) { /* user is unmuting the card */ dev->muted = 0; outb (0xd8, io); /* enable card */ } - mutex_unlock(&lock); + up(&lock); return 0; } @@ -108,7 +108,7 @@ static int rt_setvol(struct rt_device *dev, int vol) sleep_delay(2000000); /* make sure it's totally down */ outb(0xd0, io); /* volume steady, off */ dev->curvol = 0; /* track the volume state! */ - mutex_unlock(&lock); + up(&lock); return 0; } @@ -121,7 +121,7 @@ static int rt_setvol(struct rt_device *dev, int vol) rt_decvol(); dev->curvol = vol; - mutex_unlock(&lock); + up(&lock); return 0; } @@ -168,7 +168,7 @@ static int rt_setfreq(struct rt_device *dev, unsigned long freq) freq += 171200; /* Add 10.7 MHz IF */ freq /= 800; /* Convert to 50 kHz units */ - mutex_lock(&lock); /* Stop other ops interfering */ + down(&lock); /* Stop other ops interfering */ send_0_byte (io, dev); /* 0: LSB of frequency */ @@ -196,7 +196,7 @@ static int rt_setfreq(struct rt_device *dev, unsigned long freq) else outb (0xd8, io); /* volume steady + sigstr + on */ - mutex_unlock(&lock); + up(&lock); return 0; } @@ -337,7 +337,7 @@ static int __init rtrack_init(void) /* Set up the I/O locking */ - mutex_init(&lock); + init_MUTEX(&lock); /* mute card - prevents noisy bootups */