[alsa-devel] [PATCH 022/127] ASoC: use component probe/remove on tas2552

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

diff --git a/sound/soc/codecs/tas2552.c b/sound/soc/codecs/tas2552.c
index baf455e..1739183 100644
--- a/sound/soc/codecs/tas2552.c
+++ b/sound/soc/codecs/tas2552.c
@@ -567,8 +567,9 @@ static const struct snd_kcontrol_new tas2552_snd_controls[] = {
 	SOC_ENUM("DIN source", tas2552_din_source_enum),
 };
 
-static int tas2552_codec_probe(struct snd_soc_codec *codec)
+static int tas2552_codec_probe(struct snd_soc_component *component)
 {
+	struct snd_soc_codec *codec = snd_soc_component_to_codec(component);
 	struct tas2552_data *tas2552 = snd_soc_codec_get_drvdata(codec);
 	int ret;
 
@@ -614,15 +615,14 @@ probe_fail:
 	return -EIO;
 }
 
-static int tas2552_codec_remove(struct snd_soc_codec *codec)
+static void tas2552_codec_remove(struct snd_soc_component *component)
 {
+	struct snd_soc_codec *codec = snd_soc_component_to_codec(component);
 	struct tas2552_data *tas2552 = snd_soc_codec_get_drvdata(codec);
 
 	pm_runtime_put(codec->dev);
 
 	gpiod_set_value(tas2552->enable_gpio, 0);
-
-	return 0;
 };
 
 #ifdef CONFIG_PM
@@ -661,13 +661,13 @@ static int tas2552_resume(struct snd_soc_codec *codec)
 #endif
 
 static struct snd_soc_codec_driver soc_codec_dev_tas2552 = {
-	.probe = tas2552_codec_probe,
-	.remove = tas2552_codec_remove,
 	.suspend =	tas2552_suspend,
 	.resume = tas2552_resume,
 	.ignore_pmdown_time = true,
 
 	.component_driver = {
+		.probe			= tas2552_codec_probe,
+		.remove			= tas2552_codec_remove,
 		.controls		= tas2552_snd_controls,
 		.num_controls		= ARRAY_SIZE(tas2552_snd_controls),
 		.dapm_widgets		= tas2552_dapm_widgets,
-- 
1.9.1



More information about the Alsa-devel mailing list