[alsa-devel] [PATCH 093/127] ASoC: use component probe/remove on uda1380

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

diff --git a/sound/soc/codecs/uda1380.c b/sound/soc/codecs/uda1380.c
index 533e3bb..2e2ebc9 100644
--- a/sound/soc/codecs/uda1380.c
+++ b/sound/soc/codecs/uda1380.c
@@ -687,8 +687,9 @@ static struct snd_soc_dai_driver uda1380_dai[] = {
 },
 };
 
-static int uda1380_probe(struct snd_soc_codec *codec)
+static int uda1380_probe(struct snd_soc_component *component)
 {
+	struct snd_soc_codec *codec = snd_soc_component_to_codec(component);
 	struct uda1380_platform_data *pdata =codec->dev->platform_data;
 	struct uda1380_priv *uda1380 = snd_soc_codec_get_drvdata(codec);
 	int ret;
@@ -742,19 +743,16 @@ err_out:
 }
 
 /* power down chip */
-static int uda1380_remove(struct snd_soc_codec *codec)
+static void uda1380_remove(struct snd_soc_component *component)
 {
+	struct snd_soc_codec *codec = snd_soc_component_to_codec(component);
 	struct uda1380_platform_data *pdata =codec->dev->platform_data;
 
 	gpio_free(pdata->gpio_reset);
 	gpio_free(pdata->gpio_power);
-
-	return 0;
 }
 
 static struct snd_soc_codec_driver soc_codec_dev_uda1380 = {
-	.probe =	uda1380_probe,
-	.remove =	uda1380_remove,
 	.read =		uda1380_read_reg_cache,
 	.write =	uda1380_write,
 	.set_bias_level = uda1380_set_bias_level,
@@ -766,6 +764,8 @@ static struct snd_soc_codec_driver soc_codec_dev_uda1380 = {
 	.reg_cache_step = 1,
 
 	.component_driver = {
+		.probe			= uda1380_probe,
+		.remove			= uda1380_remove,
 		.controls		= uda1380_snd_controls,
 		.num_controls		= ARRAY_SIZE(uda1380_snd_controls),
 		.dapm_widgets		= uda1380_dapm_widgets,
-- 
1.9.1



More information about the Alsa-devel mailing list