[alsa-devel] [PATCH 092/127] ASoC: use component probe/remove on wl1273

Kuninori Morimoto kuninori.morimoto.gx at renesas.com
Tue Aug 9 07:32:35 CEST 2016


From: Kuninori Morimoto <kuninori.morimoto.gx at renesas.com>

codec driver and component driver has duplicated .probe/.remove
functions, and codec side is just relayed it. This was quick-hack,
but no longer needed.
This patch uses component .probe/.remove

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx at renesas.com>
---
 sound/soc/codecs/wl1273.c | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/sound/soc/codecs/wl1273.c b/sound/soc/codecs/wl1273.c
index fcffb6e..d5005f8 100644
--- a/sound/soc/codecs/wl1273.c
+++ b/sound/soc/codecs/wl1273.c
@@ -446,8 +446,9 @@ int wl1273_get_format(struct snd_soc_codec *codec, unsigned int *fmt)
 }
 EXPORT_SYMBOL_GPL(wl1273_get_format);
 
-static int wl1273_probe(struct snd_soc_codec *codec)
+static int wl1273_probe(struct snd_soc_component *component)
 {
+	struct snd_soc_codec *codec = snd_soc_component_to_codec(component);
 	struct wl1273_core **core = codec->dev->platform_data;
 	struct wl1273_priv *wl1273;
 
@@ -470,21 +471,19 @@ static int wl1273_probe(struct snd_soc_codec *codec)
 	return 0;
 }
 
-static int wl1273_remove(struct snd_soc_codec *codec)
+static void wl1273_remove(struct snd_soc_component *component)
 {
+	struct snd_soc_codec *codec = snd_soc_component_to_codec(component);
 	struct wl1273_priv *wl1273 = snd_soc_codec_get_drvdata(codec);
 
 	dev_dbg(codec->dev, "%s\n", __func__);
 	kfree(wl1273);
-
-	return 0;
 }
 
 static struct snd_soc_codec_driver soc_codec_dev_wl1273 = {
-	.probe = wl1273_probe,
-	.remove = wl1273_remove,
-
 	.component_driver = {
+		.probe			= wl1273_probe,
+		.remove			= wl1273_remove,
 		.controls		= wl1273_controls,
 		.num_controls		= ARRAY_SIZE(wl1273_controls),
 		.dapm_widgets		= wl1273_dapm_widgets,
-- 
1.9.1



More information about the Alsa-devel mailing list