[alsa-devel] [PATCH 053/127] ASoC: use component probe/remove on ad1980
Kuninori Morimoto
kuninori.morimoto.gx at renesas.com
Tue Aug 9 07:17:52 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/ad1980.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/sound/soc/codecs/ad1980.c b/sound/soc/codecs/ad1980.c
index b7c1b9f..795294b 100644
--- a/sound/soc/codecs/ad1980.c
+++ b/sound/soc/codecs/ad1980.c
@@ -232,8 +232,9 @@ static int ad1980_reset(struct snd_soc_codec *codec, int try_warm)
return -EIO;
}
-static int ad1980_soc_probe(struct snd_soc_codec *codec)
+static int ad1980_soc_probe(struct snd_soc_component *component)
{
+ struct snd_soc_codec *codec = snd_soc_component_to_codec(component);
struct snd_ac97 *ac97;
struct regmap *regmap;
int ret;
@@ -286,8 +287,9 @@ err_free_ac97:
return ret;
}
-static int ad1980_soc_remove(struct snd_soc_codec *codec)
+static int ad1980_soc_remove(struct snd_soc_component *component)
{
+ struct snd_soc_codec *codec = snd_soc_component_to_codec(component);
struct snd_ac97 *ac97 = snd_soc_codec_get_drvdata(codec);
snd_soc_codec_exit_regmap(codec);
@@ -296,10 +298,9 @@ static int ad1980_soc_remove(struct snd_soc_codec *codec)
}
static struct snd_soc_codec_driver soc_codec_dev_ad1980 = {
- .probe = ad1980_soc_probe,
- .remove = ad1980_soc_remove,
-
.component_driver = {
+ .probe = ad1980_soc_probe,
+ .remove = ad1980_soc_remove,
.controls = ad1980_snd_ac97_controls,
.num_controls = ARRAY_SIZE(ad1980_snd_ac97_controls),
.dapm_widgets = ad1980_dapm_widgets,
--
1.9.1
More information about the Alsa-devel
mailing list