[alsa-devel] [PATCH 045/127] ASoC: use component probe/remove on adau1701

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

diff --git a/sound/soc/codecs/adau1701.c b/sound/soc/codecs/adau1701.c
index 3bad1bc..f45c959 100644
--- a/sound/soc/codecs/adau1701.c
+++ b/sound/soc/codecs/adau1701.c
@@ -664,10 +664,11 @@ static const struct of_device_id adau1701_dt_ids[] = {
 MODULE_DEVICE_TABLE(of, adau1701_dt_ids);
 #endif
 
-static int adau1701_probe(struct snd_soc_codec *codec)
+static int adau1701_probe(struct snd_soc_component *component)
 {
 	int i, ret;
 	unsigned int val;
+	struct snd_soc_codec *codec = snd_soc_component_to_codec(component);
 	struct adau1701 *adau1701 = snd_soc_codec_get_drvdata(codec);
 
 	ret = sigmadsp_attach(adau1701->sigmadsp, &codec->component);
@@ -715,16 +716,15 @@ exit_regulators_disable:
 	return ret;
 }
 
-static int adau1701_remove(struct snd_soc_codec *codec)
+static void adau1701_remove(struct snd_soc_component *component)
 {
+	struct snd_soc_codec *codec = snd_soc_component_to_codec(component);
 	struct adau1701 *adau1701 = snd_soc_codec_get_drvdata(codec);
 
 	if (gpio_is_valid(adau1701->gpio_nreset))
 		gpio_set_value_cansleep(adau1701->gpio_nreset, 0);
 
 	regulator_bulk_disable(ARRAY_SIZE(adau1701->supplies), adau1701->supplies);
-
-	return 0;
 }
 
 #ifdef CONFIG_PM
@@ -758,14 +758,14 @@ static int adau1701_resume(struct snd_soc_codec *codec)
 #endif /* CONFIG_PM */
 
 static struct snd_soc_codec_driver adau1701_codec_drv = {
-	.probe			= adau1701_probe,
-	.remove			= adau1701_remove,
 	.resume			= adau1701_resume,
 	.suspend		= adau1701_suspend,
 	.set_bias_level		= adau1701_set_bias_level,
 	.idle_bias_off		= true,
 
 	.component_driver = {
+		.probe			= adau1701_probe,
+		.remove			= adau1701_remove,
 		.controls		= adau1701_controls,
 		.num_controls		= ARRAY_SIZE(adau1701_controls),
 		.dapm_widgets		= adau1701_dapm_widgets,
-- 
1.9.1



More information about the Alsa-devel mailing list