[alsa-devel] [PATCH 121/127] ASoC: use component probe/remove on max98088

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

diff --git a/sound/soc/codecs/max98088.c b/sound/soc/codecs/max98088.c
index 72f7745..4e992c2 100644
--- a/sound/soc/codecs/max98088.c
+++ b/sound/soc/codecs/max98088.c
@@ -1628,8 +1628,9 @@ static void max98088_handle_pdata(struct snd_soc_codec *codec)
                max98088_handle_eq_pdata(codec);
 }
 
-static int max98088_probe(struct snd_soc_codec *codec)
+static int max98088_probe(struct snd_soc_component *component)
 {
+       struct snd_soc_codec *codec = snd_soc_component_to_codec(component);
        struct max98088_priv *max98088 = snd_soc_codec_get_drvdata(codec);
        struct max98088_cdata *cdata;
        int ret = 0;
@@ -1689,22 +1690,21 @@ err_access:
        return ret;
 }
 
-static int max98088_remove(struct snd_soc_codec *codec)
+static void max98088_remove(struct snd_soc_component *component)
 {
+       struct snd_soc_codec *codec = snd_soc_component_to_codec(component);
        struct max98088_priv *max98088 = snd_soc_codec_get_drvdata(codec);
 
        kfree(max98088->eq_texts);
-
-       return 0;
 }
 
 static struct snd_soc_codec_driver soc_codec_dev_max98088 = {
-	.probe   = max98088_probe,
-	.remove  = max98088_remove,
 	.set_bias_level = max98088_set_bias_level,
 	.suspend_bias_off = true,
 
 	.component_driver = {
+		.probe			= max98088_probe,
+		.remove			= max98088_remove,
 		.controls		= max98088_snd_controls,
 		.num_controls		= ARRAY_SIZE(max98088_snd_controls),
 		.dapm_widgets		= max98088_dapm_widgets,
-- 
1.9.1



More information about the Alsa-devel mailing list