diff mbox

[066/127] ASoC: use component probe/remove on wm9705

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

Commit Message

Kuninori Morimoto Aug. 9, 2016, 5:23 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/wm9705.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)
diff mbox

Patch

diff --git a/sound/soc/codecs/wm9705.c b/sound/soc/codecs/wm9705.c
index c88492d..928b51d 100644
--- a/sound/soc/codecs/wm9705.c
+++ b/sound/soc/codecs/wm9705.c
@@ -328,8 +328,9 @@  static int wm9705_soc_resume(struct snd_soc_codec *codec)
 #define wm9705_soc_resume NULL
 #endif
 
-static int wm9705_soc_probe(struct snd_soc_codec *codec)
+static int wm9705_soc_probe(struct snd_soc_component *component)
 {
+	struct snd_soc_codec *codec = snd_soc_component_to_codec(component);
 	struct snd_ac97 *ac97;
 
 	ac97 = snd_soc_new_ac97_codec(codec, WM9705_VENDOR_ID,
@@ -344,17 +345,15 @@  static int wm9705_soc_probe(struct snd_soc_codec *codec)
 	return 0;
 }
 
-static int wm9705_soc_remove(struct snd_soc_codec *codec)
+static void wm9705_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_free_ac97_codec(ac97);
-	return 0;
 }
 
 static struct snd_soc_codec_driver soc_codec_dev_wm9705 = {
-	.probe = 	wm9705_soc_probe,
-	.remove = 	wm9705_soc_remove,
 	.suspend =	wm9705_soc_suspend,
 	.resume =	wm9705_soc_resume,
 	.read = ac97_read,
@@ -365,6 +364,8 @@  static struct snd_soc_codec_driver soc_codec_dev_wm9705 = {
 	.reg_cache_default = wm9705_reg,
 
 	.component_driver = {
+		.probe			= wm9705_soc_probe,
+		.remove			= wm9705_soc_remove,
 		.controls		= wm9705_snd_ac97_controls,
 		.num_controls		= ARRAY_SIZE(wm9705_snd_ac97_controls),
 		.dapm_widgets		= wm9705_dapm_widgets,