diff options
author | Mark Brown <broonie@kernel.org> | 2014-12-05 14:58:32 -0500 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2014-12-06 07:24:27 -0500 |
commit | ba56447c3586465fd6eaf9869410dafb748a4d0d (patch) | |
tree | 774233bdcc156e652554150ace92d1da3f6b3eec /sound/soc/samsung | |
parent | d683d0b690c13437d752ccce47963ac64119b07a (diff) |
ASoC: samsung: Fix error handling for clock lookup
Return the error code we got from clk_get() and check to make sure that
clk_prepare_enable() worked.
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/samsung')
-rw-r--r-- | sound/soc/samsung/i2s.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/sound/soc/samsung/i2s.c b/sound/soc/samsung/i2s.c index 0d76bc15b785..c60ab07ef3d1 100644 --- a/sound/soc/samsung/i2s.c +++ b/sound/soc/samsung/i2s.c | |||
@@ -972,6 +972,7 @@ static int samsung_i2s_dai_probe(struct snd_soc_dai *dai) | |||
972 | { | 972 | { |
973 | struct i2s_dai *i2s = to_info(dai); | 973 | struct i2s_dai *i2s = to_info(dai); |
974 | struct i2s_dai *other = i2s->pri_dai ? : i2s->sec_dai; | 974 | struct i2s_dai *other = i2s->pri_dai ? : i2s->sec_dai; |
975 | int ret; | ||
975 | 976 | ||
976 | if (other && other->clk) { /* If this is probe on secondary */ | 977 | if (other && other->clk) { /* If this is probe on secondary */ |
977 | samsung_asoc_init_dma_data(dai, &other->sec_dai->dma_playback, | 978 | samsung_asoc_init_dma_data(dai, &other->sec_dai->dma_playback, |
@@ -989,9 +990,14 @@ static int samsung_i2s_dai_probe(struct snd_soc_dai *dai) | |||
989 | if (IS_ERR(i2s->clk)) { | 990 | if (IS_ERR(i2s->clk)) { |
990 | dev_err(&i2s->pdev->dev, "failed to get i2s_clock\n"); | 991 | dev_err(&i2s->pdev->dev, "failed to get i2s_clock\n"); |
991 | iounmap(i2s->addr); | 992 | iounmap(i2s->addr); |
992 | return -ENOENT; | 993 | return PTR_ERR(i2s->clk); |
994 | } | ||
995 | |||
996 | ret = clk_prepare_enable(i2s->clk); | ||
997 | if (ret != 0) { | ||
998 | dev_err(&i2s->pdev->dev, "failed to enable clock: %d\n", ret); | ||
999 | return ret; | ||
993 | } | 1000 | } |
994 | clk_prepare_enable(i2s->clk); | ||
995 | 1001 | ||
996 | samsung_asoc_init_dma_data(dai, &i2s->dma_playback, &i2s->dma_capture); | 1002 | samsung_asoc_init_dma_data(dai, &i2s->dma_playback, &i2s->dma_capture); |
997 | 1003 | ||