[alsa-devel] [PATCH 106/127] ASoC: use component probe/remove on rt5645
Kuninori Morimoto
kuninori.morimoto.gx at renesas.com
Tue Aug 9 07:38:31 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/rt5645.c | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/sound/soc/codecs/rt5645.c b/sound/soc/codecs/rt5645.c
index 10c2a56..8ae375b 100644
--- a/sound/soc/codecs/rt5645.c
+++ b/sound/soc/codecs/rt5645.c
@@ -3352,8 +3352,9 @@ static void rt5645_btn_check_callback(unsigned long data)
&rt5645->jack_detect_work, msecs_to_jiffies(5));
}
-static int rt5645_probe(struct snd_soc_codec *codec)
+static int rt5645_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 rt5645_priv *rt5645 = snd_soc_codec_get_drvdata(codec);
@@ -3393,10 +3394,11 @@ static int rt5645_probe(struct snd_soc_codec *codec)
return 0;
}
-static int rt5645_remove(struct snd_soc_codec *codec)
+static void rt5645_remove(struct snd_soc_component *component)
{
+ struct snd_soc_codec *codec = snd_soc_component_to_codec(component);
+
rt5645_reset(codec);
- return 0;
}
#ifdef CONFIG_PM
@@ -3478,13 +3480,13 @@ static struct snd_soc_dai_driver rt5645_dai[] = {
};
static struct snd_soc_codec_driver soc_codec_dev_rt5645 = {
- .probe = rt5645_probe,
- .remove = rt5645_remove,
.suspend = rt5645_suspend,
.resume = rt5645_resume,
.set_bias_level = rt5645_set_bias_level,
.idle_bias_off = true,
.component_driver = {
+ .probe = rt5645_probe,
+ .remove = rt5645_remove,
.controls = rt5645_snd_controls,
.num_controls = ARRAY_SIZE(rt5645_snd_controls),
.dapm_widgets = rt5645_dapm_widgets,
--
1.9.1
More information about the Alsa-devel
mailing list