aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/cs4270.c
diff options
context:
space:
mode:
authorPhilipp Zabel <philipp.zabel@gmail.com>2009-03-12 06:07:54 -0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2009-03-12 11:43:30 -0400
commiteb5f6d753e337834c7ceb07824ee472e43d9a7a2 (patch)
tree22c549607a8ed5657c98af6ae4ead1b3c0eaaaec /sound/soc/codecs/cs4270.c
parent6f7cb44ba1a5195bf719f9ba1d57bd79e13262c1 (diff)
ASoC: Replace remaining uses of snd_soc_cnew with snd_soc_add_controls.
The drivers are basically duplicating the same code over and over. As snd_soc_cnew is going to be made static some time after the next merge window, we might as well convert them now. Signed-off-by: Philipp Zabel <philipp.zabel@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
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 */