[alsa-devel] [PATCH 109/127] ASoC: use component probe/remove on rt298

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

diff --git a/sound/soc/codecs/rt298.c b/sound/soc/codecs/rt298.c
index 5555864..fe5832f 100644
--- a/sound/soc/codecs/rt298.c
+++ b/sound/soc/codecs/rt298.c
@@ -978,8 +978,9 @@ static irqreturn_t rt298_irq(int irq, void *data)
 	return IRQ_HANDLED;
 }
 
-static int rt298_probe(struct snd_soc_codec *codec)
+static int rt298_probe(struct snd_soc_component *component)
 {
+	struct snd_soc_codec *codec = snd_soc_component_to_codec(component);
 	struct rt298_priv *rt298 = snd_soc_codec_get_drvdata(codec);
 
 	rt298->codec = codec;
@@ -997,13 +998,12 @@ static int rt298_probe(struct snd_soc_codec *codec)
 	return 0;
 }
 
-static int rt298_remove(struct snd_soc_codec *codec)
+static void rt298_remove(struct snd_soc_component *component)
 {
+	struct snd_soc_codec *codec = snd_soc_component_to_codec(component);
 	struct rt298_priv *rt298 = snd_soc_codec_get_drvdata(codec);
 
 	cancel_delayed_work_sync(&rt298->jack_detect_work);
-
-	return 0;
 }
 
 #ifdef CONFIG_PM
@@ -1089,13 +1089,13 @@ static struct snd_soc_dai_driver rt298_dai[] = {
 };
 
 static struct snd_soc_codec_driver soc_codec_dev_rt298 = {
-	.probe = rt298_probe,
-	.remove = rt298_remove,
 	.suspend = rt298_suspend,
 	.resume = rt298_resume,
 	.set_bias_level = rt298_set_bias_level,
 	.idle_bias_off = true,
 	.component_driver = {
+		.probe			= rt298_probe,
+		.remove			= rt298_remove,
 		.controls		= rt298_snd_controls,
 		.num_controls		= ARRAY_SIZE(rt298_snd_controls),
 		.dapm_widgets		= rt298_dapm_widgets,
-- 
1.9.1



More information about the Alsa-devel mailing list