[alsa-devel] [PATCH 035/127] ASoC: use component probe/remove on cs42l56

Kuninori Morimoto kuninori.morimoto.gx at renesas.com
Tue Aug 9 07:09:22 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/cs42l56.c | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/sound/soc/codecs/cs42l56.c b/sound/soc/codecs/cs42l56.c
index 54c1768..2e006ed 100644
--- a/sound/soc/codecs/cs42l56.c
+++ b/sound/soc/codecs/cs42l56.c
@@ -1101,27 +1101,29 @@ static void cs42l56_free_beep(struct snd_soc_codec *codec)
 			    CS42L56_BEEP_EN_MASK, 0);
 }
 
-static int cs42l56_probe(struct snd_soc_codec *codec)
+static int cs42l56_probe(struct snd_soc_component *component)
 {
+	struct snd_soc_codec *codec = snd_soc_component_to_codec(component);
+
 	cs42l56_init_beep(codec);
 
 	return 0;
 }
 
-static int cs42l56_remove(struct snd_soc_codec *codec)
+static void cs42l56_remove(struct snd_soc_component *component)
 {
-	cs42l56_free_beep(codec);
+	struct snd_soc_codec *codec = snd_soc_component_to_codec(component);
 
-	return 0;
+	cs42l56_free_beep(codec);
 }
 
 static const struct snd_soc_codec_driver soc_codec_dev_cs42l56 = {
-	.probe = cs42l56_probe,
-	.remove = cs42l56_remove,
 	.set_bias_level = cs42l56_set_bias_level,
 	.suspend_bias_off = true,
 
 	.component_driver = {
+		.probe			= cs42l56_probe,
+		.remove			= cs42l56_remove,
 		.controls		= cs42l56_snd_controls,
 		.num_controls		= ARRAY_SIZE(cs42l56_snd_controls),
 		.dapm_widgets		= cs42l56_dapm_widgets,
-- 
1.9.1



More information about the Alsa-devel mailing list