aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc
diff options
context:
space:
mode:
authorAxel Lin <axel.lin@gmail.com>2011-09-05 22:37:48 -0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2011-09-08 18:39:51 -0400
commit0f73644f372281f2f9c33a0459dfdfc8bc77fbda (patch)
treee4b0f7af29cda197c2fc5d64b717aa4d9b4a5b99 /sound/soc
parent3ed464659a1d83a87f4ef79fab4d85a8dcf677c9 (diff)
ASoC: ad1980: Return proper error if vendor id mismatch
Return -ENODEV instead of 0 if vendor id mismatch. Signed-off-by: Axel Lin <axel.lin@gmail.com> Acked-by: Liam Girdwood <lrg@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc')
-rw-r--r--sound/soc/codecs/ad1980.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/sound/soc/codecs/ad1980.c b/sound/soc/codecs/ad1980.c
index 923b364a3e41..4c0fc30a4ccb 100644
--- a/sound/soc/codecs/ad1980.c
+++ b/sound/soc/codecs/ad1980.c
@@ -200,18 +200,22 @@ static int ad1980_soc_probe(struct snd_soc_codec *codec)
200 } 200 }
201 201
202 /* Read out vendor ID to make sure it is ad1980 */ 202 /* Read out vendor ID to make sure it is ad1980 */
203 if (ac97_read(codec, AC97_VENDOR_ID1) != 0x4144) 203 if (ac97_read(codec, AC97_VENDOR_ID1) != 0x4144) {
204 ret = -ENODEV;
204 goto reset_err; 205 goto reset_err;
206 }
205 207
206 vendor_id2 = ac97_read(codec, AC97_VENDOR_ID2); 208 vendor_id2 = ac97_read(codec, AC97_VENDOR_ID2);
207 209
208 if (vendor_id2 != 0x5370) { 210 if (vendor_id2 != 0x5370) {
209 if (vendor_id2 != 0x5374) 211 if (vendor_id2 != 0x5374) {
212 ret = -ENODEV;
210 goto reset_err; 213 goto reset_err;
211 else 214 } else {
212 printk(KERN_WARNING "ad1980: " 215 printk(KERN_WARNING "ad1980: "
213 "Found AD1981 - only 2/2 IN/OUT Channels " 216 "Found AD1981 - only 2/2 IN/OUT Channels "
214 "supported\n"); 217 "supported\n");
218 }
215 } 219 }
216 220
217 /* unmute captures and playbacks volume */ 221 /* unmute captures and playbacks volume */