diff options
-rw-r--r-- | sound/soc/sh/rcar/src.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/sound/soc/sh/rcar/src.c b/sound/soc/sh/rcar/src.c index c30119533107..0a56ccd40e1a 100644 --- a/sound/soc/sh/rcar/src.c +++ b/sound/soc/sh/rcar/src.c | |||
@@ -525,16 +525,17 @@ static int rsnd_src_set_convert_rate_gen2(struct rsnd_mod *mod, | |||
525 | struct rsnd_dai_stream *io = rsnd_mod_to_io(mod); | 525 | struct rsnd_dai_stream *io = rsnd_mod_to_io(mod); |
526 | struct snd_pcm_runtime *runtime = rsnd_io_to_runtime(io); | 526 | struct snd_pcm_runtime *runtime = rsnd_io_to_runtime(io); |
527 | struct rsnd_src *src = rsnd_mod_to_src(mod); | 527 | struct rsnd_src *src = rsnd_mod_to_src(mod); |
528 | u32 convert_rate = rsnd_src_convert_rate(src); | ||
528 | uint ratio; | 529 | uint ratio; |
529 | int ret; | 530 | int ret; |
530 | 531 | ||
531 | /* 6 - 1/6 are very enough ratio for SRC_BSDSR */ | 532 | /* 6 - 1/6 are very enough ratio for SRC_BSDSR */ |
532 | if (!rsnd_src_convert_rate(src)) | 533 | if (!convert_rate) |
533 | ratio = 0; | 534 | ratio = 0; |
534 | else if (rsnd_src_convert_rate(src) > runtime->rate) | 535 | else if (convert_rate > runtime->rate) |
535 | ratio = 100 * rsnd_src_convert_rate(src) / runtime->rate; | 536 | ratio = 100 * convert_rate / runtime->rate; |
536 | else | 537 | else |
537 | ratio = 100 * runtime->rate / rsnd_src_convert_rate(src); | 538 | ratio = 100 * runtime->rate / convert_rate; |
538 | 539 | ||
539 | if (ratio > 600) { | 540 | if (ratio > 600) { |
540 | dev_err(dev, "FSO/FSI ratio error\n"); | 541 | dev_err(dev, "FSO/FSI ratio error\n"); |