diff mbox

[100/127] ASoC: use component probe/remove on stac9766

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

Commit Message

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

Patch

diff --git a/sound/soc/codecs/stac9766.c b/sound/soc/codecs/stac9766.c
index 2c5941f..1750588 100644
--- a/sound/soc/codecs/stac9766.c
+++ b/sound/soc/codecs/stac9766.c
@@ -297,8 +297,9 @@  static struct snd_soc_dai_driver stac9766_dai[] = {
 }
 };
 
-static int stac9766_codec_probe(struct snd_soc_codec *codec)
+static int stac9766_codec_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, STAC9766_VENDOR_ID,
@@ -311,16 +312,18 @@  static int stac9766_codec_probe(struct snd_soc_codec *codec)
 	return 0;
 }
 
-static int stac9766_codec_remove(struct snd_soc_codec *codec)
+static void stac9766_codec_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_stac9766 = {
 	.component_driver = {
+		.probe			= stac9766_codec_probe,
+		.remove			= stac9766_codec_remove,
 		.controls		= stac9766_snd_ac97_controls,
 		.num_controls		= ARRAY_SIZE(stac9766_snd_ac97_controls),
 	},
@@ -328,8 +331,6 @@  static struct snd_soc_codec_driver soc_codec_dev_stac9766 = {
 	.read = stac9766_ac97_read,
 	.set_bias_level = stac9766_set_bias_level,
 	.suspend_bias_off = true,
-	.probe = stac9766_codec_probe,
-	.remove = stac9766_codec_remove,
 	.resume = stac9766_codec_resume,
 	.reg_cache_size = ARRAY_SIZE(stac9766_reg),
 	.reg_word_size = sizeof(u16),