[alsa-devel] [PATCH 071/127] ASoC: use component probe/remove on wm8996

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

diff --git a/sound/soc/codecs/wm8996.c b/sound/soc/codecs/wm8996.c
index abacf6c..43e01bb 100644
--- a/sound/soc/codecs/wm8996.c
+++ b/sound/soc/codecs/wm8996.c
@@ -2614,9 +2614,10 @@ static const struct regmap_config wm8996_regmap = {
 	.cache_type = REGCACHE_RBTREE,
 };
 
-static int wm8996_probe(struct snd_soc_codec *codec)
+static int wm8996_probe(struct snd_soc_component *component)
 {
 	int ret;
+	struct snd_soc_codec *codec = snd_soc_component_to_codec(component);
 	struct wm8996_priv *wm8996 = snd_soc_codec_get_drvdata(codec);
 	struct i2c_client *i2c = to_i2c_client(codec->dev);
 	int irq_flags;
@@ -2671,8 +2672,9 @@ static int wm8996_probe(struct snd_soc_codec *codec)
 	return 0;
 }
 
-static int wm8996_remove(struct snd_soc_codec *codec)
+static void wm8996_remove(struct snd_soc_component *component)
 {
+	struct snd_soc_codec *codec = snd_soc_component_to_codec(component);
 	struct i2c_client *i2c = to_i2c_client(codec->dev);
 
 	snd_soc_update_bits(codec, WM8996_INTERRUPT_CONTROL,
@@ -2680,17 +2682,15 @@ static int wm8996_remove(struct snd_soc_codec *codec)
 
 	if (i2c->irq)
 		free_irq(i2c->irq, codec);
-
-	return 0;
 }
 
 static struct snd_soc_codec_driver soc_codec_dev_wm8996 = {
-	.probe =	wm8996_probe,
-	.remove =	wm8996_remove,
 	.set_bias_level = wm8996_set_bias_level,
 	.idle_bias_off	= true,
 	.seq_notifier = wm8996_seq_notifier,
 	.component_driver = {
+		.probe			= wm8996_probe,
+		.remove			= wm8996_remove,
 		.controls		= wm8996_snd_controls,
 		.num_controls		= ARRAY_SIZE(wm8996_snd_controls),
 		.dapm_widgets		= wm8996_dapm_widgets,
-- 
1.9.1



More information about the Alsa-devel mailing list