[alsa-devel] [PATCH 072/127] ASoC: use component probe/remove on wm8995

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

diff --git a/sound/soc/codecs/wm8995.c b/sound/soc/codecs/wm8995.c
index 19b08a5..15be86c 100644
--- a/sound/soc/codecs/wm8995.c
+++ b/sound/soc/codecs/wm8995.c
@@ -1994,8 +1994,9 @@ static int wm8995_set_bias_level(struct snd_soc_codec *codec,
 	return 0;
 }
 
-static int wm8995_remove(struct snd_soc_codec *codec)
+static void wm8995_remove(struct snd_soc_component *component)
 {
+	struct snd_soc_codec *codec = snd_soc_component_to_codec(component);
 	struct wm8995_priv *wm8995;
 	int i;
 
@@ -2006,11 +2007,11 @@ static int wm8995_remove(struct snd_soc_codec *codec)
 					      &wm8995->disable_nb[i]);
 
 	regulator_bulk_free(ARRAY_SIZE(wm8995->supplies), wm8995->supplies);
-	return 0;
 }
 
-static int wm8995_probe(struct snd_soc_codec *codec)
+static int wm8995_probe(struct snd_soc_component *component)
 {
+	struct snd_soc_codec *codec = snd_soc_component_to_codec(component);
 	struct wm8995_priv *wm8995;
 	int i;
 	int ret;
@@ -2187,12 +2188,12 @@ static struct snd_soc_dai_driver wm8995_dai[] = {
 };
 
 static const struct snd_soc_codec_driver soc_codec_dev_wm8995 = {
-	.probe = wm8995_probe,
-	.remove = wm8995_remove,
 	.set_bias_level = wm8995_set_bias_level,
 	.idle_bias_off = true,
 
 	.component_driver = {
+		.probe			= wm8995_probe,
+		.remove			= wm8995_remove,
 		.controls		= wm8995_snd_controls,
 		.num_controls		= ARRAY_SIZE(wm8995_snd_controls),
 		.dapm_widgets		= wm8995_dapm_widgets,
-- 
1.9.1



More information about the Alsa-devel mailing list