[alsa-devel] [PATCH 107/127] ASoC: use component probe/remove on rt5640

Kuninori Morimoto kuninori.morimoto.gx at renesas.com
Tue Aug 9 07:38:58 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/rt5640.c | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/sound/soc/codecs/rt5640.c b/sound/soc/codecs/rt5640.c
index fbe3af1..24aa8a0 100644
--- a/sound/soc/codecs/rt5640.c
+++ b/sound/soc/codecs/rt5640.c
@@ -2109,8 +2109,9 @@ int rt5640_sel_asrc_clk_src(struct snd_soc_codec *codec,
 }
 EXPORT_SYMBOL_GPL(rt5640_sel_asrc_clk_src);
 
-static int rt5640_probe(struct snd_soc_codec *codec)
+static int rt5640_probe(struct snd_soc_component *component)
 {
+	struct snd_soc_codec *codec = snd_soc_component_to_codec(component);
 	struct snd_soc_dapm_context *dapm = snd_soc_codec_get_dapm(codec);
 	struct rt5640_priv *rt5640 = snd_soc_codec_get_drvdata(codec);
 
@@ -2161,11 +2162,11 @@ static int rt5640_probe(struct snd_soc_codec *codec)
 	return 0;
 }
 
-static int rt5640_remove(struct snd_soc_codec *codec)
+static void rt5640_remove(struct snd_soc_component *component)
 {
-	rt5640_reset(codec);
+	struct snd_soc_codec *codec = snd_soc_component_to_codec(component);
 
-	return 0;
+	rt5640_reset(codec);
 }
 
 #ifdef CONFIG_PM
@@ -2255,13 +2256,13 @@ static struct snd_soc_dai_driver rt5640_dai[] = {
 };
 
 static struct snd_soc_codec_driver soc_codec_dev_rt5640 = {
-	.probe = rt5640_probe,
-	.remove = rt5640_remove,
 	.suspend = rt5640_suspend,
 	.resume = rt5640_resume,
 	.set_bias_level = rt5640_set_bias_level,
 	.idle_bias_off = true,
 	.component_driver = {
+		.probe			= rt5640_probe,
+		.remove			= rt5640_remove,
 		.controls		= rt5640_snd_controls,
 		.num_controls		= ARRAY_SIZE(rt5640_snd_controls),
 		.dapm_widgets		= rt5640_dapm_widgets,
-- 
1.9.1



More information about the Alsa-devel mailing list