summaryrefslogtreecommitdiffstats
path: root/sound/soc/pxa/palm27x.c
diff options
context:
space:
mode:
authorMike Dunn <mikedunn@newsguy.com>2012-12-29 10:53:18 -0800
committerMark Brown <broonie@opensource.wolfsonmicro.com>2013-01-02 13:07:01 +0000
commit01a61f490cab732542753db69e17e5db657d185a (patch)
tree508af8d577f1160c9510684af7b91d7ee8a5d874 /sound/soc/pxa/palm27x.c
parent016fb39c98a71539d9abd5ee66cc1103a32fbb34 (diff)
downloadop-kernel-dev-01a61f490cab732542753db69e17e5db657d185a.zip
op-kernel-dev-01a61f490cab732542753db69e17e5db657d185a.tar.gz
ASoC: palm27x: register card in platform_driver probe
Remove creation of an soc-audio device from the machine platform_driver probe function, and add a call to snd_soc_register_card() instead. The current code still works, but this mechanism has been deprecated, if I'm not mistaken. The ASoC core code produces the warning "ASoC: machine Palm/PXA27x should use snd_soc_register_card()" Signed-off-by: Mike Dunn <mikedunn@newsguy.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/pxa/palm27x.c')
-rw-r--r--sound/soc/pxa/palm27x.c23
1 files changed, 6 insertions, 17 deletions
diff --git a/sound/soc/pxa/palm27x.c b/sound/soc/pxa/palm27x.c
index bb062e6..e1ffcdd 100644
--- a/sound/soc/pxa/palm27x.c
+++ b/sound/soc/pxa/palm27x.c
@@ -144,8 +144,6 @@ static struct snd_soc_card palm27x_asoc = {
.num_dapm_routes = ARRAY_SIZE(audio_map)
};
-static struct platform_device *palm27x_snd_device;
-
static int palm27x_asoc_probe(struct platform_device *pdev)
{
int ret;
@@ -162,27 +160,18 @@ static int palm27x_asoc_probe(struct platform_device *pdev)
hs_jack_gpios[0].gpio = ((struct palm27x_asoc_info *)
(pdev->dev.platform_data))->jack_gpio;
- palm27x_snd_device = platform_device_alloc("soc-audio", -1);
- if (!palm27x_snd_device)
- return -ENOMEM;
-
- platform_set_drvdata(palm27x_snd_device, &palm27x_asoc);
- ret = platform_device_add(palm27x_snd_device);
-
- if (ret != 0)
- goto put_device;
-
- return 0;
-
-put_device:
- platform_device_put(palm27x_snd_device);
+ palm27x_asoc.dev = &pdev->dev;
+ ret = snd_soc_register_card(&palm27x_asoc);
+ if (ret)
+ dev_err(&pdev->dev, "snd_soc_register_card() failed: %d\n",
+ ret);
return ret;
}
static int palm27x_asoc_remove(struct platform_device *pdev)
{
- platform_device_unregister(palm27x_snd_device);
+ snd_soc_unregister_card(&palm27x_asoc);
return 0;
}
OpenPOWER on IntegriCloud