[alsa-devel] [PATCH 111/127] ASoC: use component probe/remove on nau8825

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

diff --git a/sound/soc/codecs/nau8825.c b/sound/soc/codecs/nau8825.c
index 822791eb..f02a371 100644
--- a/sound/soc/codecs/nau8825.c
+++ b/sound/soc/codecs/nau8825.c
@@ -1832,8 +1832,9 @@ static const struct regmap_config nau8825_regmap_config = {
 	.num_reg_defaults = ARRAY_SIZE(nau8825_reg_defaults),
 };
 
-static int nau8825_codec_probe(struct snd_soc_codec *codec)
+static int nau8825_codec_probe(struct snd_soc_component *component)
 {
+	struct snd_soc_codec *codec = snd_soc_component_to_codec(component);
 	struct nau8825 *nau8825 = snd_soc_codec_get_drvdata(codec);
 	struct snd_soc_dapm_context *dapm = snd_soc_codec_get_dapm(codec);
 
@@ -1842,14 +1843,13 @@ static int nau8825_codec_probe(struct snd_soc_codec *codec)
 	return 0;
 }
 
-static int nau8825_codec_remove(struct snd_soc_codec *codec)
+static void nau8825_codec_remove(struct snd_soc_component *component)
 {
+	struct snd_soc_codec *codec = snd_soc_component_to_codec(component);
 	struct nau8825 *nau8825 = snd_soc_codec_get_drvdata(codec);
 
 	/* Cancel and reset cross tak suppresstion detection funciton */
 	nau8825_xtalk_cancel(nau8825);
-
-	return 0;
 }
 
 /**
@@ -2261,8 +2261,6 @@ static int __maybe_unused nau8825_resume(struct snd_soc_codec *codec)
 }
 
 static struct snd_soc_codec_driver nau8825_codec_driver = {
-	.probe = nau8825_codec_probe,
-	.remove = nau8825_codec_remove,
 	.set_sysclk = nau8825_set_sysclk,
 	.set_pll = nau8825_set_pll,
 	.set_bias_level = nau8825_set_bias_level,
@@ -2271,6 +2269,8 @@ static struct snd_soc_codec_driver nau8825_codec_driver = {
 	.resume = nau8825_resume,
 
 	.component_driver = {
+		.probe			= nau8825_codec_probe,
+		.remove			= nau8825_codec_remove,
 		.controls		= nau8825_controls,
 		.num_controls		= ARRAY_SIZE(nau8825_controls),
 		.dapm_widgets		= nau8825_dapm_widgets,
-- 
1.9.1



More information about the Alsa-devel mailing list