[alsa-devel] [PATCH 095/127] ASoC: use component probe/remove on twl6040

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

diff --git a/sound/soc/codecs/twl6040.c b/sound/soc/codecs/twl6040.c
index 748036e..38e702f 100644
--- a/sound/soc/codecs/twl6040.c
+++ b/sound/soc/codecs/twl6040.c
@@ -1097,8 +1097,9 @@ static struct snd_soc_dai_driver twl6040_dai[] = {
 },
 };
 
-static int twl6040_probe(struct snd_soc_codec *codec)
+static int twl6040_probe(struct snd_soc_component *component)
 {
+	struct snd_soc_codec *codec = snd_soc_component_to_codec(component);
 	struct twl6040_data *priv;
 	struct twl6040 *twl6040 = dev_get_drvdata(codec->dev->parent);
 	struct platform_device *pdev = to_platform_device(codec->dev);
@@ -1138,18 +1139,15 @@ static int twl6040_probe(struct snd_soc_codec *codec)
 	return 0;
 }
 
-static int twl6040_remove(struct snd_soc_codec *codec)
+static void twl6040_remove(struct snd_soc_component *component)
 {
+	struct snd_soc_codec *codec = snd_soc_component_to_codec(component);
 	struct twl6040_data *priv = snd_soc_codec_get_drvdata(codec);
 
 	free_irq(priv->plug_irq, codec);
-
-	return 0;
 }
 
 static struct snd_soc_codec_driver soc_codec_dev_twl6040 = {
-	.probe = twl6040_probe,
-	.remove = twl6040_remove,
 	.read = twl6040_read,
 	.write = twl6040_write,
 	.set_bias_level = twl6040_set_bias_level,
@@ -1157,6 +1155,8 @@ static struct snd_soc_codec_driver soc_codec_dev_twl6040 = {
 	.ignore_pmdown_time = true,
 
 	.component_driver = {
+		.probe			= twl6040_probe,
+		.remove			= twl6040_remove,
 		.controls		= twl6040_snd_controls,
 		.num_controls		= ARRAY_SIZE(twl6040_snd_controls),
 		.dapm_widgets		= twl6040_dapm_widgets,
-- 
1.9.1



More information about the Alsa-devel mailing list