[alsa-devel] [PATCH 123/127] ASoC: use component probe/remove on hdac_hdmi
Kuninori Morimoto
kuninori.morimoto.gx at renesas.com
Tue Aug 9 07:44:31 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/hdac_hdmi.c | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/sound/soc/codecs/hdac_hdmi.c b/sound/soc/codecs/hdac_hdmi.c
index 4e181b2..b9d1f5c 100644
--- a/sound/soc/codecs/hdac_hdmi.c
+++ b/sound/soc/codecs/hdac_hdmi.c
@@ -1459,8 +1459,9 @@ int hdac_hdmi_jack_init(struct snd_soc_dai *dai, int device)
}
EXPORT_SYMBOL_GPL(hdac_hdmi_jack_init);
-static int hdmi_codec_probe(struct snd_soc_codec *codec)
+static int hdmi_codec_probe(struct snd_soc_component *component)
{
+ struct snd_soc_codec *codec = snd_soc_component_to_codec(component);
struct hdac_ext_device *edev = snd_soc_codec_get_drvdata(codec);
struct hdac_hdmi_priv *hdmi = edev->private_data;
struct snd_soc_dapm_context *dapm =
@@ -1512,12 +1513,12 @@ static int hdmi_codec_probe(struct snd_soc_codec *codec)
return 0;
}
-static int hdmi_codec_remove(struct snd_soc_codec *codec)
+static void hdmi_codec_remove(struct snd_soc_component *component)
{
+ struct snd_soc_codec *codec = snd_soc_component_to_codec(component);
struct hdac_ext_device *edev = snd_soc_codec_get_drvdata(codec);
pm_runtime_disable(&edev->hdac.dev);
- return 0;
}
#ifdef CONFIG_PM
@@ -1571,9 +1572,11 @@ static void hdmi_codec_complete(struct device *dev)
#endif
static struct snd_soc_codec_driver hdmi_hda_codec = {
- .probe = hdmi_codec_probe,
- .remove = hdmi_codec_remove,
.idle_bias_off = true,
+ .component_driver = {
+ .probe = hdmi_codec_probe,
+ .remove = hdmi_codec_remove,
+ },
};
static void hdac_hdmi_get_chmap(struct hdac_device *hdac, int pcm_idx,
--
1.9.1
More information about the Alsa-devel
mailing list