[alsa-devel] [PATCH 070/127] ASoC: use component probe/remove on wm8997
Kuninori Morimoto
kuninori.morimoto.gx at renesas.com
Tue Aug 9 07:24:53 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/wm8997.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/sound/soc/codecs/wm8997.c b/sound/soc/codecs/wm8997.c
index cf23a6b..acdb6e2 100644
--- a/sound/soc/codecs/wm8997.c
+++ b/sound/soc/codecs/wm8997.c
@@ -1052,8 +1052,9 @@ static struct snd_soc_dai_driver wm8997_dai[] = {
},
};
-static int wm8997_codec_probe(struct snd_soc_codec *codec)
+static int wm8997_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 wm8997_priv *priv = snd_soc_codec_get_drvdata(codec);
@@ -1066,15 +1067,14 @@ static int wm8997_codec_probe(struct snd_soc_codec *codec)
return 0;
}
-static int wm8997_codec_remove(struct snd_soc_codec *codec)
+static void wm8997_codec_remove(struct snd_soc_component *component)
{
+ struct snd_soc_codec *codec = snd_soc_component_to_codec(component);
struct wm8997_priv *priv = snd_soc_codec_get_drvdata(codec);
priv->core.arizona->dapm = NULL;
arizona_free_spk(codec);
-
- return 0;
}
#define WM8997_DIG_VU 0x0200
@@ -1096,8 +1096,6 @@ static struct regmap *wm8997_get_regmap(struct device *dev)
}
static struct snd_soc_codec_driver soc_codec_dev_wm8997 = {
- .probe = wm8997_codec_probe,
- .remove = wm8997_codec_remove,
.get_regmap = wm8997_get_regmap,
.idle_bias_off = true,
@@ -1106,6 +1104,8 @@ static struct snd_soc_codec_driver soc_codec_dev_wm8997 = {
.set_pll = wm8997_set_fll,
.component_driver = {
+ .probe = wm8997_codec_probe,
+ .remove = wm8997_codec_remove,
.controls = wm8997_snd_controls,
.num_controls = ARRAY_SIZE(wm8997_snd_controls),
.dapm_widgets = wm8997_dapm_widgets,
--
1.9.1
More information about the Alsa-devel
mailing list