summaryrefslogtreecommitdiffstats
path: root/sound/sh
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2019-05-08 14:45:38 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-01-27 14:50:46 +0100
commitf94e6d7c312db65568277db3c17263836ba69fe5 (patch)
treefb3e1e3cf7f76f1115a68a58af356a2bf073e081 /sound/sh
parent2f11aba20728694486845e5680c33c664be0e583 (diff)
downloadlinux-stable-f94e6d7c312db65568277db3c17263836ba69fe5.tar.gz
linux-stable-f94e6d7c312db65568277db3c17263836ba69fe5.tar.bz2
linux-stable-f94e6d7c312db65568277db3c17263836ba69fe5.zip
ALSA: aica: Fix a long-time build breakage
[ Upstream commit 534420c6ff87d3052540f1fd346e0adcff440819 ] The build of aica sound driver has been broken since the timer API conversion and some code rewrite. This patch fixes the breakage by using the common substream field, as well as a bit cleaning up wrt the timer handling in the code. Fixes: d522bb6a105f ("ALSA: sh: aica: Convert timers to use timer_setup()") Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'sound/sh')
-rw-r--r--sound/sh/aica.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/sound/sh/aica.c b/sound/sh/aica.c
index 2b26311405a4..ad3f71358486 100644
--- a/sound/sh/aica.c
+++ b/sound/sh/aica.c
@@ -303,7 +303,7 @@ static void aica_period_elapsed(struct timer_list *t)
{
struct snd_card_aica *dreamcastcard = from_timer(dreamcastcard,
t, timer);
- struct snd_pcm_substream *substream = dreamcastcard->timer_substream;
+ struct snd_pcm_substream *substream = dreamcastcard->substream;
/*timer function - so cannot sleep */
int play_period;
struct snd_pcm_runtime *runtime;
@@ -335,13 +335,6 @@ static void spu_begin_dma(struct snd_pcm_substream *substream)
dreamcastcard = substream->pcm->private_data;
/*get the queue to do the work */
schedule_work(&(dreamcastcard->spu_dma_work));
- /* Timer may already be running */
- if (unlikely(dreamcastcard->timer_substream)) {
- mod_timer(&dreamcastcard->timer, jiffies + 4);
- return;
- }
- timer_setup(&dreamcastcard->timer, aica_period_elapsed, 0);
- dreamcastcard->timer_substream = substream;
mod_timer(&dreamcastcard->timer, jiffies + 4);
}
@@ -379,8 +372,8 @@ static int snd_aicapcm_pcm_close(struct snd_pcm_substream
{
struct snd_card_aica *dreamcastcard = substream->pcm->private_data;
flush_work(&(dreamcastcard->spu_dma_work));
- if (dreamcastcard->timer_substream)
- del_timer(&dreamcastcard->timer);
+ del_timer(&dreamcastcard->timer);
+ dreamcastcard->substream = NULL;
kfree(dreamcastcard->channel);
spu_disable();
return 0;
@@ -615,6 +608,7 @@ static int snd_aica_probe(struct platform_device *devptr)
"Yamaha AICA Super Intelligent Sound Processor for SEGA Dreamcast");
/* Prepare to use the queue */
INIT_WORK(&(dreamcastcard->spu_dma_work), run_spu_dma);
+ timer_setup(&dreamcastcard->timer, aica_period_elapsed, 0);
/* Load the PCM 'chip' */
err = snd_aicapcmchip(dreamcastcard, 0);
if (unlikely(err < 0))