diff options
author | Bard Liao <bardliao@realtek.com> | 2014-05-06 09:56:06 +0200 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2014-05-12 23:09:30 +0200 |
commit | 57f174f47e73b4e6f325c9374c17f5fe1602e496 (patch) | |
tree | 820737ff87e85dc429ad2f6e55312b6e45b5f15c | |
parent | ASoC: rt5640: correct 5640's device ID (diff) | |
download | linux-57f174f47e73b4e6f325c9374c17f5fe1602e496.tar.xz linux-57f174f47e73b4e6f325c9374c17f5fe1602e496.zip |
ASoC: rt5640: add default case for unexpected ID
We may read an unexpected value when detemining which codec is attached.
In that case, either a unsupported codec is attached or something wrong
with I2C. The driver will not work properly on both cases. So we return
an error for that.
Signed-off-by: Bard Liao <bardliao@realtek.com>
Reviewed-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
-rw-r--r-- | sound/soc/codecs/rt5640.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/sound/soc/codecs/rt5640.c b/sound/soc/codecs/rt5640.c index 2133fa0c5114..ddefd5a476d0 100644 --- a/sound/soc/codecs/rt5640.c +++ b/sound/soc/codecs/rt5640.c @@ -2018,6 +2018,10 @@ static int rt5640_probe(struct snd_soc_codec *codec) rt5639_specific_dapm_routes, ARRAY_SIZE(rt5639_specific_dapm_routes)); break; + default: + dev_err(codec->dev, + "The driver is for RT5639 RT5640 or RT5642 only\n"); + return -ENODEV; } return 0; |