From 12b81232fc9ec86a7da8d3794c9eab41a2ac0c32 Mon Sep 17 00:00:00 2001 From: Kuninori Morimoto Date: Tue, 12 Oct 2010 18:30:14 +0900 Subject: [PATCH] --- yaml --- r: 216627 b: refs/heads/master c: 00545785d7e355b0b1b9fb820ec70cb2ae51b409 h: refs/heads/master i: 216625: 9ceff367e4e15d76935c943b6203618ca04dfd3b 216623: 26fd04ee20453e31760d8af534fc46eeb83d772c v: v3 --- [refs] | 2 +- trunk/sound/soc/sh/fsi.c | 13 +++++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/[refs] b/[refs] index cab1bb4853d6..1dada584834d 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: cf6edd007b6c371613a2f48e58f3a4238d9775c8 +refs/heads/master: 00545785d7e355b0b1b9fb820ec70cb2ae51b409 diff --git a/trunk/sound/soc/sh/fsi.c b/trunk/sound/soc/sh/fsi.c index 685bb7c4f039..dfc04bc2809e 100644 --- a/trunk/sound/soc/sh/fsi.c +++ b/trunk/sound/soc/sh/fsi.c @@ -294,6 +294,11 @@ static u32 fsi_get_info_flags(struct fsi_priv *fsi) master->info->portb_flags; } +static inline int fsi_is_play(struct snd_pcm_substream *substream) +{ + return substream->stream == SNDRV_PCM_STREAM_PLAYBACK; +} + static int fsi_is_master_mode(struct fsi_priv *fsi, int is_play) { u32 mode; @@ -726,7 +731,7 @@ static int fsi_dai_startup(struct snd_pcm_substream *substream, u32 fmt; u32 reg; u32 data; - int is_play = (substream->stream == SNDRV_PCM_STREAM_PLAYBACK); + int is_play = fsi_is_play(substream); int is_master; pm_runtime_get_sync(dai->dev); @@ -813,7 +818,7 @@ static void fsi_dai_shutdown(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) { struct fsi_priv *fsi = fsi_get_priv(substream); - int is_play = substream->stream == SNDRV_PCM_STREAM_PLAYBACK; + int is_play = fsi_is_play(substream); fsi_irq_disable(fsi, is_play); fsi_clk_ctrl(fsi, 0); @@ -826,7 +831,7 @@ static int fsi_dai_trigger(struct snd_pcm_substream *substream, int cmd, { struct fsi_priv *fsi = fsi_get_priv(substream); struct snd_pcm_runtime *runtime = substream->runtime; - int is_play = substream->stream == SNDRV_PCM_STREAM_PLAYBACK; + int is_play = fsi_is_play(substream); int ret = 0; switch (cmd) { @@ -853,7 +858,7 @@ static int fsi_dai_hw_params(struct snd_pcm_substream *substream, struct fsi_master *master = fsi_get_master(fsi); int (*set_rate)(int is_porta, int rate) = master->info->set_rate; int fsi_ver = master->core->ver; - int is_play = (substream->stream == SNDRV_PCM_STREAM_PLAYBACK); + int is_play = fsi_is_play(substream); int ret; /* if slave mode, set_rate is not needed */