]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
ALSA: Remove unneeded snd_pcm_substream.timer_lock
authorTakashi Iwai <tiwai@suse.de>
Fri, 6 Mar 2009 15:30:07 +0000 (16:30 +0100)
committerTakashi Iwai <tiwai@suse.de>
Mon, 9 Mar 2009 13:02:00 +0000 (14:02 +0100)
The timer callbacks are called in the protected status by the lock
of the timer instance, so there is no need for an extra lock in the
PCM substream.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
include/sound/pcm.h
sound/core/pcm.c
sound/core/pcm_timer.c

index 40c5a6fa6bcd3635334f0405ee0d53f37c3944c7..e4f60076e6c4004c2c56a653fee1f24fea6278bf 100644 (file)
@@ -364,7 +364,6 @@ struct snd_pcm_substream {
         /* -- timer section -- */
        struct snd_timer *timer;                /* timer */
        unsigned timer_running: 1;      /* time is running */
-       spinlock_t timer_lock;
        /* -- next substream -- */
        struct snd_pcm_substream *next;
        /* -- linked substreams -- */
index 192a433a240309bd1ce4e977cfa3c6f34d646a85..37f567a68ef20d9b156a96901a3949f9c92d181a 100644 (file)
@@ -667,7 +667,6 @@ int snd_pcm_new_stream(struct snd_pcm *pcm, int stream, int substream_count)
                spin_lock_init(&substream->self_group.lock);
                INIT_LIST_HEAD(&substream->self_group.substreams);
                list_add_tail(&substream->link_list, &substream->self_group.substreams);
-               spin_lock_init(&substream->timer_lock);
                atomic_set(&substream->mmap_count, 0);
                prev = substream;
        }
index 2c89c04f29163766dde1c6b9f6f7a296310343f3..ca8068b63d6c1bc413d16a2309d7d33fbe378893 100644 (file)
@@ -85,25 +85,19 @@ static unsigned long snd_pcm_timer_resolution(struct snd_timer * timer)
 
 static int snd_pcm_timer_start(struct snd_timer * timer)
 {
-       unsigned long flags;
        struct snd_pcm_substream *substream;
        
        substream = snd_timer_chip(timer);
-       spin_lock_irqsave(&substream->timer_lock, flags);
        substream->timer_running = 1;
-       spin_unlock_irqrestore(&substream->timer_lock, flags);
        return 0;
 }
 
 static int snd_pcm_timer_stop(struct snd_timer * timer)
 {
-       unsigned long flags;
        struct snd_pcm_substream *substream;
        
        substream = snd_timer_chip(timer);
-       spin_lock_irqsave(&substream->timer_lock, flags);
        substream->timer_running = 0;
-       spin_unlock_irqrestore(&substream->timer_lock, flags);
        return 0;
 }