[alsa-devel] [PATCH 060/127] ASoC: use component probe/remove on cs47l24

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

diff --git a/sound/soc/codecs/cs47l24.c b/sound/soc/codecs/cs47l24.c
index 779a7bf..8eeb746 100644
--- a/sound/soc/codecs/cs47l24.c
+++ b/sound/soc/codecs/cs47l24.c
@@ -1102,8 +1102,9 @@ static irqreturn_t cs47l24_adsp2_irq(int irq, void *data)
 	return IRQ_HANDLED;
 }
 
-static int cs47l24_codec_probe(struct snd_soc_codec *codec)
+static int cs47l24_codec_probe(struct snd_soc_component *component)
 {
+	struct snd_soc_codec *codec = snd_soc_component_to_codec(component);
 	struct snd_soc_dapm_context *dapm = snd_soc_codec_get_dapm(codec);
 	struct cs47l24_priv *priv = snd_soc_codec_get_drvdata(codec);
 	struct arizona *arizona = priv->core.arizona;
@@ -1148,8 +1149,9 @@ err_adsp2_codec_probe:
 	return ret;
 }
 
-static int cs47l24_codec_remove(struct snd_soc_codec *codec)
+static void cs47l24_codec_remove(struct snd_soc_component *component)
 {
+	struct snd_soc_codec *codec = snd_soc_component_to_codec(component);
 	struct cs47l24_priv *priv = snd_soc_codec_get_drvdata(codec);
 	struct arizona *arizona = priv->core.arizona;
 
@@ -1161,8 +1163,6 @@ static int cs47l24_codec_remove(struct snd_soc_codec *codec)
 	arizona_free_irq(arizona, ARIZONA_IRQ_DSP_IRQ1, priv);
 
 	arizona_free_spk(codec);
-
-	return 0;
 }
 
 #define CS47L24_DIG_VU 0x0200
@@ -1181,8 +1181,6 @@ static struct regmap *cs47l24_get_regmap(struct device *dev)
 }
 
 static struct snd_soc_codec_driver soc_codec_dev_cs47l24 = {
-	.probe = cs47l24_codec_probe,
-	.remove = cs47l24_codec_remove,
 	.get_regmap = cs47l24_get_regmap,
 
 	.idle_bias_off = true,
@@ -1191,6 +1189,8 @@ static struct snd_soc_codec_driver soc_codec_dev_cs47l24 = {
 	.set_pll = cs47l24_set_fll,
 
 	.component_driver = {
+		.probe			= cs47l24_codec_probe,
+		.remove			= cs47l24_codec_remove,
 		.controls		= cs47l24_snd_controls,
 		.num_controls		= ARRAY_SIZE(cs47l24_snd_controls),
 		.dapm_widgets		= cs47l24_dapm_widgets,
-- 
1.9.1



More information about the Alsa-devel mailing list