[alsa-devel] [PATCH 069/127] ASoC: use component probe/remove on wm8998
Kuninori Morimoto
kuninori.morimoto.gx at renesas.com
Tue Aug 9 07:24:35 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/wm8998.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/sound/soc/codecs/wm8998.c b/sound/soc/codecs/wm8998.c
index 315b23b..657b593 100644
--- a/sound/soc/codecs/wm8998.c
+++ b/sound/soc/codecs/wm8998.c
@@ -1304,8 +1304,9 @@ static int wm8998_set_fll(struct snd_soc_codec *codec, int fll_id, int source,
}
}
-static int wm8998_codec_probe(struct snd_soc_codec *codec)
+static int wm8998_codec_probe(struct snd_soc_component *component)
{
+ struct snd_soc_codec *codec = snd_soc_component_to_codec(component);
struct wm8998_priv *priv = snd_soc_codec_get_drvdata(codec);
struct snd_soc_dapm_context *dapm = snd_soc_codec_get_dapm(codec);
@@ -1319,15 +1320,14 @@ static int wm8998_codec_probe(struct snd_soc_codec *codec)
return 0;
}
-static int wm8998_codec_remove(struct snd_soc_codec *codec)
+static void wm8998_codec_remove(struct snd_soc_component *component)
{
+ struct snd_soc_codec *codec = snd_soc_component_to_codec(component);
struct wm8998_priv *priv = snd_soc_codec_get_drvdata(codec);
priv->core.arizona->dapm = NULL;
arizona_free_spk(codec);
-
- return 0;
}
#define WM8998_DIG_VU 0x0200
@@ -1352,8 +1352,6 @@ static struct regmap *wm8998_get_regmap(struct device *dev)
}
static struct snd_soc_codec_driver soc_codec_dev_wm8998 = {
- .probe = wm8998_codec_probe,
- .remove = wm8998_codec_remove,
.get_regmap = wm8998_get_regmap,
.idle_bias_off = true,
@@ -1362,6 +1360,8 @@ static struct snd_soc_codec_driver soc_codec_dev_wm8998 = {
.set_pll = wm8998_set_fll,
.component_driver = {
+ .probe = wm8998_codec_probe,
+ .remove = wm8998_codec_remove,
.controls = wm8998_snd_controls,
.num_controls = ARRAY_SIZE(wm8998_snd_controls),
.dapm_widgets = wm8998_dapm_widgets,
--
1.9.1
More information about the Alsa-devel
mailing list