[alsa-devel] [PATCH 064/127] ASoC: use component probe/remove on wm9713

Kuninori Morimoto kuninori.morimoto.gx at renesas.com
Tue Aug 9 07:22:32 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/wm9713.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/sound/soc/codecs/wm9713.c b/sound/soc/codecs/wm9713.c
index 255a7c2..50b1156 100644
--- a/sound/soc/codecs/wm9713.c
+++ b/sound/soc/codecs/wm9713.c
@@ -1202,8 +1202,9 @@ static int wm9713_soc_resume(struct snd_soc_codec *codec)
 	return ret;
 }
 
-static int wm9713_soc_probe(struct snd_soc_codec *codec)
+static int wm9713_soc_probe(struct snd_soc_component *component)
 {
+	struct snd_soc_codec *codec = snd_soc_component_to_codec(component);
 	struct wm9713_priv *wm9713 = snd_soc_codec_get_drvdata(codec);
 	struct regmap *regmap;
 
@@ -1226,23 +1227,23 @@ static int wm9713_soc_probe(struct snd_soc_codec *codec)
 	return 0;
 }
 
-static int wm9713_soc_remove(struct snd_soc_codec *codec)
+static void wm9713_soc_remove(struct snd_soc_component *component)
 {
+	struct snd_soc_codec *codec = snd_soc_component_to_codec(component);
 	struct wm9713_priv *wm9713 = snd_soc_codec_get_drvdata(codec);
 
 	snd_soc_codec_exit_regmap(codec);
 	snd_soc_free_ac97_codec(wm9713->ac97);
-	return 0;
 }
 
 static struct snd_soc_codec_driver soc_codec_dev_wm9713 = {
-	.probe = 	wm9713_soc_probe,
-	.remove = 	wm9713_soc_remove,
 	.suspend =	wm9713_soc_suspend,
 	.resume = 	wm9713_soc_resume,
 	.set_bias_level = wm9713_set_bias_level,
 
 	.component_driver = {
+		.probe			= wm9713_soc_probe,
+		.remove			= wm9713_soc_remove,
 		.controls		= wm9713_snd_ac97_controls,
 		.num_controls		= ARRAY_SIZE(wm9713_snd_ac97_controls),
 		.dapm_widgets		= wm9713_dapm_widgets,
-- 
1.9.1



More information about the Alsa-devel mailing list