Commit bab4445f authored by Vinod Koul's avatar Vinod Koul Committed by Takashi Iwai

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: default avatarJeeja KP <jeeja.kp@intel.com>
Signed-off-by: default avatarVinod Koul <vinod.koul@intel.com>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent e7a3484d
...@@ -90,6 +90,7 @@ void snd_hdac_ext_stream_init(struct hdac_ext_bus *bus, ...@@ -90,6 +90,7 @@ void snd_hdac_ext_stream_init(struct hdac_ext_bus *bus,
int snd_hdac_ext_stream_init_all(struct hdac_ext_bus *ebus, int start_idx, int snd_hdac_ext_stream_init_all(struct hdac_ext_bus *ebus, int start_idx,
int num_stream, int dir); int num_stream, int dir);
void snd_hdac_stream_free_all(struct hdac_ext_bus *ebus); void snd_hdac_stream_free_all(struct hdac_ext_bus *ebus);
void snd_hdac_link_free_all(struct hdac_ext_bus *ebus);
struct hdac_ext_stream *snd_hdac_ext_stream_assign(struct hdac_ext_bus *bus, struct hdac_ext_stream *snd_hdac_ext_stream_assign(struct hdac_ext_bus *bus,
struct snd_pcm_substream *substream, struct snd_pcm_substream *substream,
int type); int type);
......
...@@ -193,6 +193,24 @@ int snd_hdac_ext_bus_get_ml_capabilities(struct hdac_ext_bus *ebus) ...@@ -193,6 +193,24 @@ int snd_hdac_ext_bus_get_ml_capabilities(struct hdac_ext_bus *ebus)
} }
EXPORT_SYMBOL_GPL(snd_hdac_ext_bus_get_ml_capabilities); 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 * snd_hdac_ext_bus_get_link_index - get link based on codec name
* @ebus: HD-audio extended core bus * @ebus: HD-audio extended core bus
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment