summaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorVinod Koul <vinod.koul@intel.com>2015-06-17 08:50:17 +0300
committerTakashi Iwai <tiwai@suse.de>2015-06-17 13:33:08 +0300
commitbab4445f9a083f087d0ebb4ba3e9dde669a6b9a5 (patch)
tree9e05f2326a6142c015fd257b2b9cf6c92e10499e /sound
parente7a3484dc5b15aa69e44a8b29d9a6e512fa3f922 (diff)
downloadlinux-bab4445f9a083f087d0ebb4ba3e9dde669a6b9a5.tar.xz
ALSA: hda: add hda link cleanup routine
In HDA extended bus the HDA link objects are created when multilink capabilities are parsed. We need a routine which free up these link objects for a bus. So add snd_hdac_link_free_all routine Signed-off-by: Jeeja KP <jeeja.kp@intel.com> Signed-off-by: Vinod Koul <vinod.koul@intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound')
-rw-r--r--sound/hda/ext/hdac_ext_controller.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/sound/hda/ext/hdac_ext_controller.c b/sound/hda/ext/hdac_ext_controller.c
index adffc89541c9..b2da19b60f4e 100644
--- a/sound/hda/ext/hdac_ext_controller.c
+++ b/sound/hda/ext/hdac_ext_controller.c
@@ -194,6 +194,24 @@ int snd_hdac_ext_bus_get_ml_capabilities(struct hdac_ext_bus *ebus)
EXPORT_SYMBOL_GPL(snd_hdac_ext_bus_get_ml_capabilities);
/**
+ * snd_hdac_link_free_all- free hdac extended link objects
+ *
+ * @ebus: HD-audio ext core bus
+ */
+
+void snd_hdac_link_free_all(struct hdac_ext_bus *ebus)
+{
+ struct hdac_ext_link *l;
+
+ while (!list_empty(&ebus->hlink_list)) {
+ l = list_first_entry(&ebus->hlink_list, struct hdac_ext_link, list);
+ list_del(&l->list);
+ kfree(l);
+ }
+}
+EXPORT_SYMBOL_GPL(snd_hdac_link_free_all);
+
+/**
* snd_hdac_ext_bus_get_link_index - get link based on codec name
* @ebus: HD-audio extended core bus
* @codec_name: codec name