[alsa-devel] [PATCH 110/127] ASoC: use component probe/remove on rt286

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

diff --git a/sound/soc/codecs/rt286.c b/sound/soc/codecs/rt286.c
index 9c365a7..ecd35fb 100644
--- a/sound/soc/codecs/rt286.c
+++ b/sound/soc/codecs/rt286.c
@@ -937,8 +937,9 @@ static irqreturn_t rt286_irq(int irq, void *data)
 	return IRQ_HANDLED;
 }
 
-static int rt286_probe(struct snd_soc_codec *codec)
+static int rt286_probe(struct snd_soc_component *component)
 {
+	struct snd_soc_codec *codec = snd_soc_component_to_codec(component);
 	struct rt286_priv *rt286 = snd_soc_codec_get_drvdata(codec);
 
 	rt286->codec = codec;
@@ -956,13 +957,12 @@ static int rt286_probe(struct snd_soc_codec *codec)
 	return 0;
 }
 
-static int rt286_remove(struct snd_soc_codec *codec)
+static void rt286_remove(struct snd_soc_component *component)
 {
+	struct snd_soc_codec *codec = snd_soc_component_to_codec(component);
 	struct rt286_priv *rt286 = snd_soc_codec_get_drvdata(codec);
 
 	cancel_delayed_work_sync(&rt286->jack_detect_work);
-
-	return 0;
 }
 
 #ifdef CONFIG_PM
@@ -1047,13 +1047,13 @@ static struct snd_soc_dai_driver rt286_dai[] = {
 };
 
 static struct snd_soc_codec_driver soc_codec_dev_rt286 = {
-	.probe = rt286_probe,
-	.remove = rt286_remove,
 	.suspend = rt286_suspend,
 	.resume = rt286_resume,
 	.set_bias_level = rt286_set_bias_level,
 	.idle_bias_off = true,
 	.component_driver = {
+		.probe			= rt286_probe,
+		.remove			= rt286_remove,
 		.controls		= rt286_snd_controls,
 		.num_controls		= ARRAY_SIZE(rt286_snd_controls),
 		.dapm_widgets		= rt286_dapm_widgets,
-- 
1.9.1



More information about the Alsa-devel mailing list