From cc1d0cd817bad5dab50732a6668a87ff3eac3b5c Mon Sep 17 00:00:00 2001 From: Kai Vehmanen Date: Wed, 15 Jul 2020 20:45:50 +0300 Subject: [PATCH 1/2] ALSA: hda: export snd_hda_codec_cleanup_for_unbind() To avoid duplicated code for cleanup, and match the already exported snd_hda_codec_pcm_new(), also export snd_hda_codec_cleanup_for_unbind(). Signed-off-by: Kai Vehmanen Reviewed-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Reviewed-by: Takashi Iwai Link: https://lore.kernel.org/r/20200715174551.3730165-2-kai.vehmanen@linux.intel.com Signed-off-by: Mark Brown --- include/sound/hda_codec.h | 2 ++ sound/pci/hda/hda_codec.c | 1 + 2 files changed, 3 insertions(+) diff --git a/include/sound/hda_codec.h b/include/sound/hda_codec.h index d16a4229209b..e378ed7f4824 100644 --- a/include/sound/hda_codec.h +++ b/include/sound/hda_codec.h @@ -415,6 +415,8 @@ __printf(2, 3) struct hda_pcm *snd_hda_codec_pcm_new(struct hda_codec *codec, const char *fmt, ...); +void snd_hda_codec_cleanup_for_unbind(struct hda_codec *codec); + static inline void snd_hda_codec_pcm_get(struct hda_pcm *pcm) { kref_get(&pcm->kref); diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c index 7e3ae4534df9..b4331355602c 100644 --- a/sound/pci/hda/hda_codec.c +++ b/sound/pci/hda/hda_codec.c @@ -792,6 +792,7 @@ void snd_hda_codec_cleanup_for_unbind(struct hda_codec *codec) remove_conn_list(codec); snd_hdac_regmap_exit(&codec->core); } +EXPORT_SYMBOL_GPL(snd_hda_codec_cleanup_for_unbind); static unsigned int hda_set_power_state(struct hda_codec *codec, unsigned int power_state); From 95ce82ac3c476688e3cf81ab04f9c5ac0a31e5ae Mon Sep 17 00:00:00 2001 From: Kai Vehmanen Date: Wed, 15 Jul 2020 20:45:51 +0300 Subject: [PATCH 2/2] ALSA: hda: fix snd_hda_codec_cleanup() documentation Fix a copy and paste error in snd_hda_codec_cleanup() documentation. Signed-off-by: Kai Vehmanen Reviewed-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Reviewed-by: Takashi Iwai Link: https://lore.kernel.org/r/20200715174551.3730165-3-kai.vehmanen@linux.intel.com Signed-off-by: Mark Brown --- sound/pci/hda/hda_codec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c index b4331355602c..3576e2d8452f 100644 --- a/sound/pci/hda/hda_codec.c +++ b/sound/pci/hda/hda_codec.c @@ -3179,7 +3179,7 @@ int snd_hda_codec_prepare(struct hda_codec *codec, EXPORT_SYMBOL_GPL(snd_hda_codec_prepare); /** - * snd_hda_codec_cleanup - Prepare a stream + * snd_hda_codec_cleanup - Clean up stream resources * @codec: the HDA codec * @hinfo: PCM information * @substream: PCM substream