Skip to content

Commit

Permalink
ASoC: rcar: bugfix: it cares about the non-src case
Browse files Browse the repository at this point in the history
src might not exist.
kernel will be hung-up without this patch in such case.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
  • Loading branch information
Kuninori Morimoto authored and Mark Brown committed Mar 24, 2014
1 parent 90e8e50 commit b1eac43
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions sound/soc/sh/rcar/src.c
Original file line number Diff line number Diff line change
Expand Up @@ -182,16 +182,20 @@ unsigned int rsnd_src_get_ssi_rate(struct rsnd_priv *priv,
struct rsnd_dai_stream *io,
struct snd_pcm_runtime *runtime)
{
struct rsnd_mod *src_mod = rsnd_io_to_mod_src(io);
struct rsnd_src *src;
unsigned int rate;
unsigned int rate = 0;

src = rsnd_mod_to_src(rsnd_io_to_mod_src(io));
if (src_mod) {
src = rsnd_mod_to_src(src_mod);

/*
* return convert rate if SRC is used,
* otherwise, return runtime->rate as usual
*/
rate = rsnd_src_convert_rate(src);
}

/*
* return convert rate if SRC is used,
* otherwise, return runtime->rate as usual
*/
rate = rsnd_src_convert_rate(src);
if (!rate)
rate = runtime->rate;

Expand Down

0 comments on commit b1eac43

Please sign in to comment.