diff mbox

[065/127] ASoC: use component probe/remove on wm9712

Message ID 874m6ubk18.wl%kuninori.morimoto.gx@renesas.com (mailing list archive)
State New, archived
Headers show

Commit Message

Kuninori Morimoto Aug. 9, 2016, 5:22 a.m. UTC
From: Kuninori Morimoto <kuninori.morimoto.gx@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@renesas.com>
---
 sound/soc/codecs/wm9712.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)
diff mbox

Patch

diff --git a/sound/soc/codecs/wm9712.c b/sound/soc/codecs/wm9712.c
index e5aafdd..d7d504a 100644
--- a/sound/soc/codecs/wm9712.c
+++ b/sound/soc/codecs/wm9712.c
@@ -642,8 +642,9 @@  static int wm9712_soc_resume(struct snd_soc_codec *codec)
 	return ret;
 }
 
-static int wm9712_soc_probe(struct snd_soc_codec *codec)
+static int wm9712_soc_probe(struct snd_soc_component *component)
 {
+	struct snd_soc_codec *codec = snd_soc_component_to_codec(component);
 	struct wm9712_priv *wm9712 = snd_soc_codec_get_drvdata(codec);
 	int ret;
 
@@ -661,17 +662,15 @@  static int wm9712_soc_probe(struct snd_soc_codec *codec)
 	return 0;
 }
 
-static int wm9712_soc_remove(struct snd_soc_codec *codec)
+static void wm9712_soc_remove(struct snd_soc_component *component)
 {
+	struct snd_soc_codec *codec = snd_soc_component_to_codec(component);
 	struct wm9712_priv *wm9712 = snd_soc_codec_get_drvdata(codec);
 
 	snd_soc_free_ac97_codec(wm9712->ac97);
-	return 0;
 }
 
 static struct snd_soc_codec_driver soc_codec_dev_wm9712 = {
-	.probe = 	wm9712_soc_probe,
-	.remove = 	wm9712_soc_remove,
 	.resume =	wm9712_soc_resume,
 	.read = ac97_read,
 	.write = ac97_write,
@@ -683,6 +682,8 @@  static struct snd_soc_codec_driver soc_codec_dev_wm9712 = {
 	.reg_cache_default = wm9712_reg,
 
 	.component_driver = {
+		.probe			= wm9712_soc_probe,
+		.remove			= wm9712_soc_remove,
 		.controls		= wm9712_snd_ac97_controls,
 		.num_controls		= ARRAY_SIZE(wm9712_snd_ac97_controls),
 		.dapm_widgets		= wm9712_dapm_widgets,