summaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/cs4270.c
diff options
context:
space:
mode:
authorPhilipp Zabel <philipp.zabel@gmail.com>2009-03-12 11:07:54 +0100
committerMark Brown <broonie@opensource.wolfsonmicro.com>2009-03-12 16:43:30 +0100
commiteb5f6d753e337834c7ceb07824ee472e43d9a7a2 (patch)
tree22c549607a8ed5657c98af6ae4ead1b3c0eaaaec /sound/soc/codecs/cs4270.c
parentASoC: Move WM8580 to normal I2C device probe (diff)
downloadlinux-eb5f6d753e337834c7ceb07824ee472e43d9a7a2.tar.xz
linux-eb5f6d753e337834c7ceb07824ee472e43d9a7a2.zip
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)
{
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 */