[alsa-devel] [PATCH 127/127] ASoC: remove codec duplicated .probe/.remove

Kuninori Morimoto kuninori.morimoto.gx at renesas.com
Tue Aug 9 07:46:07 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 removes codec side .probe/.remove

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx at renesas.com>
---
 include/sound/soc.h  |  2 --
 sound/soc/soc-core.c | 18 ------------------
 2 files changed, 20 deletions(-)

diff --git a/include/sound/soc.h b/include/sound/soc.h
index 5eb2b38..ee1d361 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -892,8 +892,6 @@ struct snd_soc_codec {
 struct snd_soc_codec_driver {
 
 	/* driver ops */
-	int (*probe)(struct snd_soc_codec *);
-	int (*remove)(struct snd_soc_codec *);
 	int (*suspend)(struct snd_soc_codec *);
 	int (*resume)(struct snd_soc_codec *);
 	struct snd_soc_component_driver component_driver;
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index edba975..3e2f0b0 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -3262,20 +3262,6 @@ static void fixup_codec_formats(struct snd_soc_pcm_stream *stream)
 			stream->formats |= codec_format_map[i];
 }
 
-static int snd_soc_codec_drv_probe(struct snd_soc_component *component)
-{
-	struct snd_soc_codec *codec = snd_soc_component_to_codec(component);
-
-	return codec->driver->probe(codec);
-}
-
-static void snd_soc_codec_drv_remove(struct snd_soc_component *component)
-{
-	struct snd_soc_codec *codec = snd_soc_component_to_codec(component);
-
-	codec->driver->remove(codec);
-}
-
 static int snd_soc_codec_drv_write(struct snd_soc_component *component,
 	unsigned int reg, unsigned int val)
 {
@@ -3333,10 +3319,6 @@ int snd_soc_register_codec(struct device *dev,
 	if (ret)
 		goto err_free;
 
-	if (codec_drv->probe)
-		codec->component.probe = snd_soc_codec_drv_probe;
-	if (codec_drv->remove)
-		codec->component.remove = snd_soc_codec_drv_remove;
 	if (codec_drv->write)
 		codec->component.write = snd_soc_codec_drv_write;
 	if (codec_drv->read)
-- 
1.9.1



More information about the Alsa-devel mailing list