aboutsummaryrefslogtreecommitdiffstats
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 2137670c9b78..7fa09a387622 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)
540{ 540{
541 struct snd_soc_device *socdev = platform_get_drvdata(pdev); 541 struct snd_soc_device *socdev = platform_get_drvdata(pdev);
542 struct snd_soc_codec *codec = cs4270_codec; 542 struct snd_soc_codec *codec = cs4270_codec;
543 unsigned int i;
544 int ret; 543 int ret;
545 544
546 /* Connect the codec to the socdev. snd_soc_new_pcms() needs this. */ 545 /* Connect the codec to the socdev. snd_soc_new_pcms() needs this. */
@@ -554,23 +553,11 @@ static int cs4270_probe(struct platform_device *pdev)
554 } 553 }
555 554
556 /* Add the non-DAPM controls */ 555 /* Add the non-DAPM controls */
557 for (i = 0; i < ARRAY_SIZE(cs4270_snd_controls); i++) { 556 ret = snd_soc_add_controls(codec, cs4270_snd_controls,
558 struct snd_kcontrol *kctrl; 557 ARRAY_SIZE(cs4270_snd_controls));
559 558 if (ret < 0) {
560 kctrl = snd_soc_cnew(&cs4270_snd_controls[i], codec, NULL); 559 dev_err(codec->dev, "failed to add controls\n");
561 if (!kctrl) { 560 goto error_free_pcms;
562 dev_err(codec->dev, "error creating control '%s'\n",
563 cs4270_snd_controls[i].name);
564 ret = -ENOMEM;
565 goto error_free_pcms;
566 }
567
568 ret = snd_ctl_add(codec->card, kctrl);
569 if (ret < 0) {
570 dev_err(codec->dev, "error adding control '%s'\n",
571 cs4270_snd_controls[i].name);
572 goto error_free_pcms;
573 }
574 } 561 }
575 562
576 /* And finally, register the socdev */ 563 /* And finally, register the socdev */