[alsa-devel] [PATCH 073/127] ASoC: use component probe/remove on wm8994
Kuninori Morimoto
kuninori.morimoto.gx at renesas.com
Tue Aug 9 07:25:57 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/wm8994.c | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/sound/soc/codecs/wm8994.c b/sound/soc/codecs/wm8994.c
index a18aecb..620588e 100644
--- a/sound/soc/codecs/wm8994.c
+++ b/sound/soc/codecs/wm8994.c
@@ -3983,8 +3983,9 @@ static irqreturn_t wm8994_temp_shut(int irq, void *data)
return IRQ_HANDLED;
}
-static int wm8994_codec_probe(struct snd_soc_codec *codec)
+static int wm8994_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 wm8994 *control = dev_get_drvdata(codec->dev->parent);
struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec);
@@ -4388,8 +4389,9 @@ err_irq:
return ret;
}
-static int wm8994_codec_remove(struct snd_soc_codec *codec)
+static void wm8994_codec_remove(struct snd_soc_component *component)
{
+ struct snd_soc_codec *codec = snd_soc_component_to_codec(component);
struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec);
struct wm8994 *control = wm8994->wm8994;
int i;
@@ -4429,7 +4431,6 @@ static int wm8994_codec_remove(struct snd_soc_codec *codec)
release_firmware(wm8994->mbc_vss);
release_firmware(wm8994->enh_eq);
kfree(wm8994->retune_mobile_texts);
- return 0;
}
static struct regmap *wm8994_get_regmap(struct device *dev)
@@ -4440,12 +4441,14 @@ static struct regmap *wm8994_get_regmap(struct device *dev)
}
static struct snd_soc_codec_driver soc_codec_dev_wm8994 = {
- .probe = wm8994_codec_probe,
- .remove = wm8994_codec_remove,
.suspend = wm8994_codec_suspend,
.resume = wm8994_codec_resume,
.get_regmap = wm8994_get_regmap,
.set_bias_level = wm8994_set_bias_level,
+ .component_driver = {
+ .probe = wm8994_codec_probe,
+ .remove = wm8994_codec_remove,
+ },
};
static int wm8994_probe(struct platform_device *pdev)
--
1.9.1
More information about the Alsa-devel
mailing list