ALSA: Remove unneeded snd_pcm_substream.timer_lock

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Linux Kernel Mailing List
Date: Thursday, March 26, 2009 - 12:05 pm

Gitweb:     http://git.kernel.org/linus/85122ea40c4fc82af5b66b8683f525c2c4a36d1a
Commit:     85122ea40c4fc82af5b66b8683f525c2c4a36d1a
Parent:     ed3da3d9a0ef13c6fe1414ec73c9c1be12747b62
Author:     Takashi Iwai <tiwai@suse.de>
AuthorDate: Fri Mar 6 16:30:07 2009 +0100
Committer:  Takashi Iwai <tiwai@suse.de>
CommitDate: Mon Mar 9 14:02:00 2009 +0100

    ALSA: Remove unneeded snd_pcm_substream.timer_lock
    
    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    |    1 -
 sound/core/pcm.c       |    1 -
 sound/core/pcm_timer.c |    6 ------
 3 files changed, 0 insertions(+), 8 deletions(-)

diff --git a/include/sound/pcm.h b/include/sound/pcm.h
index 40c5a6f..e4f6007 100644
--- a/include/sound/pcm.h
+++ b/include/sound/pcm.h
@@ -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 -- */
diff --git a/sound/core/pcm.c b/sound/core/pcm.c
index 192a433..37f567a 100644
--- a/sound/core/pcm.c
+++ b/sound/core/pcm.c
@@ -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;
 	}
diff --git a/sound/core/pcm_timer.c b/sound/core/pcm_timer.c
index 2c89c04..ca8068b 100644
--- a/sound/core/pcm_timer.c
+++ b/sound/core/pcm_timer.c
@@ -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;
 }
 
--
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
ALSA: Remove unneeded snd_pcm_substream.timer_lock, Linux Kernel Mailing ..., (Thu Mar 26, 12:05 pm)