diff options
author | Mike Dunn <mikedunn@newsguy.com> | 2012-12-29 13:53:18 -0500 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2013-01-02 08:07:01 -0500 |
commit | 01a61f490cab732542753db69e17e5db657d185a (patch) | |
tree | 508af8d577f1160c9510684af7b91d7ee8a5d874 | |
parent | 016fb39c98a71539d9abd5ee66cc1103a32fbb34 (diff) |
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>
-rw-r--r-- | sound/soc/pxa/palm27x.c | 23 |
1 files changed, 6 insertions, 17 deletions
diff --git a/sound/soc/pxa/palm27x.c b/sound/soc/pxa/palm27x.c index bb062e6b9db5..e1ffcdd9a649 100644 --- a/sound/soc/pxa/palm27x.c +++ b/sound/soc/pxa/palm27x.c | |||
@@ -144,8 +144,6 @@ static struct snd_soc_card palm27x_asoc = { | |||
144 | .num_dapm_routes = ARRAY_SIZE(audio_map) | 144 | .num_dapm_routes = ARRAY_SIZE(audio_map) |
145 | }; | 145 | }; |
146 | 146 | ||
147 | static struct platform_device *palm27x_snd_device; | ||
148 | |||
149 | static int palm27x_asoc_probe(struct platform_device *pdev) | 147 | static int palm27x_asoc_probe(struct platform_device *pdev) |
150 | { | 148 | { |
151 | int ret; | 149 | int ret; |
@@ -162,27 +160,18 @@ static int palm27x_asoc_probe(struct platform_device *pdev) | |||
162 | hs_jack_gpios[0].gpio = ((struct palm27x_asoc_info *) | 160 | hs_jack_gpios[0].gpio = ((struct palm27x_asoc_info *) |
163 | (pdev->dev.platform_data))->jack_gpio; | 161 | (pdev->dev.platform_data))->jack_gpio; |
164 | 162 | ||
165 | palm27x_snd_device = platform_device_alloc("soc-audio", -1); | 163 | palm27x_asoc.dev = &pdev->dev; |
166 | if (!palm27x_snd_device) | ||
167 | return -ENOMEM; | ||
168 | |||
169 | platform_set_drvdata(palm27x_snd_device, &palm27x_asoc); | ||
170 | ret = platform_device_add(palm27x_snd_device); | ||
171 | |||
172 | if (ret != 0) | ||
173 | goto put_device; | ||
174 | |||
175 | return 0; | ||
176 | |||
177 | put_device: | ||
178 | platform_device_put(palm27x_snd_device); | ||
179 | 164 | ||
165 | ret = snd_soc_register_card(&palm27x_asoc); | ||
166 | if (ret) | ||
167 | dev_err(&pdev->dev, "snd_soc_register_card() failed: %d\n", | ||
168 | ret); | ||
180 | return ret; | 169 | return ret; |
181 | } | 170 | } |
182 | 171 | ||
183 | static int palm27x_asoc_remove(struct platform_device *pdev) | 172 | static int palm27x_asoc_remove(struct platform_device *pdev) |
184 | { | 173 | { |
185 | platform_device_unregister(palm27x_snd_device); | 174 | snd_soc_unregister_card(&palm27x_asoc); |
186 | return 0; | 175 | return 0; |
187 | } | 176 | } |
188 | 177 | ||