Skip to content

Commit

Permalink
ASoC: rt5640: add default case for unexpected ID
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Bard Liao authored and Mark Brown committed May 12, 2014
1 parent 4eefa0d commit 57f174f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions sound/soc/codecs/rt5640.c
Original file line number Diff line number Diff line change
@@ -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;

0 comments on commit 57f174f

Please sign in to comment.