[alsa-devel] [PATCH 019/127] ASoC: use component probe/remove on tlv320aic31xx

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

diff --git a/sound/soc/codecs/tlv320aic31xx.c b/sound/soc/codecs/tlv320aic31xx.c
index e46fb47..ea2f986 100644
--- a/sound/soc/codecs/tlv320aic31xx.c
+++ b/sound/soc/codecs/tlv320aic31xx.c
@@ -1058,9 +1058,10 @@ static int aic31xx_set_bias_level(struct snd_soc_codec *codec,
 	return 0;
 }
 
-static int aic31xx_codec_probe(struct snd_soc_codec *codec)
+static int aic31xx_codec_probe(struct snd_soc_component *component)
 {
 	int ret = 0;
+	struct snd_soc_codec *codec = snd_soc_component_to_codec(component);
 	struct aic31xx_priv *aic31xx = snd_soc_codec_get_drvdata(codec);
 	int i;
 
@@ -1096,25 +1097,24 @@ static int aic31xx_codec_probe(struct snd_soc_codec *codec)
 	return ret;
 }
 
-static int aic31xx_codec_remove(struct snd_soc_codec *codec)
+static void aic31xx_codec_remove(struct snd_soc_component *component)
 {
+	struct snd_soc_codec *codec = snd_soc_component_to_codec(component);
 	struct aic31xx_priv *aic31xx = snd_soc_codec_get_drvdata(codec);
 	int i;
 
 	for (i = 0; i < ARRAY_SIZE(aic31xx->supplies); i++)
 		regulator_unregister_notifier(aic31xx->supplies[i].consumer,
 					      &aic31xx->disable_nb[i].nb);
-
-	return 0;
 }
 
 static struct snd_soc_codec_driver soc_codec_driver_aic31xx = {
-	.probe			= aic31xx_codec_probe,
-	.remove			= aic31xx_codec_remove,
 	.set_bias_level		= aic31xx_set_bias_level,
 	.suspend_bias_off	= true,
 
 	.component_driver = {
+		.probe			= aic31xx_codec_probe,
+		.remove			= aic31xx_codec_remove,
 		.controls		= aic31xx_snd_controls,
 		.num_controls		= ARRAY_SIZE(aic31xx_snd_controls),
 		.dapm_widgets		= aic31xx_dapm_widgets,
-- 
1.9.1



More information about the Alsa-devel mailing list