summaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/cs4270.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/codecs/cs4270.c')
-rw-r--r--sound/soc/codecs/cs4270.c23
1 files changed, 5 insertions, 18 deletions
diff --git a/sound/soc/codecs/cs4270.c b/sound/soc/codecs/cs4270.c
index 2137670c9b7..7fa09a38762 100644
--- a/sound/soc/codecs/cs4270.c
+++ b/sound/soc/codecs/cs4270.c
@@ -540,7 +540,6 @@ static int cs4270_probe(struct platform_device *pdev)
{
struct snd_soc_device *socdev = platform_get_drvdata(pdev);
struct snd_soc_codec *codec = cs4270_codec;
- unsigned int i;
int ret;
/* Connect the codec to the socdev. snd_soc_new_pcms() needs this. */
@@ -554,23 +553,11 @@ static int cs4270_probe(struct platform_device *pdev)
}
/* Add the non-DAPM controls */
- for (i = 0; i < ARRAY_SIZE(cs4270_snd_controls); i++) {
- struct snd_kcontrol *kctrl;
-
- kctrl = snd_soc_cnew(&cs4270_snd_controls[i], codec, NULL);
- if (!kctrl) {
- dev_err(codec->dev, "error creating control '%s'\n",
- cs4270_snd_controls[i].name);
- ret = -ENOMEM;
- goto error_free_pcms;
- }
-
- ret = snd_ctl_add(codec->card, kctrl);
- if (ret < 0) {
- dev_err(codec->dev, "error adding control '%s'\n",
- cs4270_snd_controls[i].name);
- goto error_free_pcms;
- }
+ ret = snd_soc_add_controls(codec, cs4270_snd_controls,
+ ARRAY_SIZE(cs4270_snd_controls));
+ if (ret < 0) {
+ dev_err(codec->dev, "failed to add controls\n");
+ goto error_free_pcms;
}
/* And finally, register the socdev */