diff options
| author | Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> | 2022-10-27 15:35:37 -0400 |
|---|---|---|
| committer | Mark Brown <broonie@kernel.org> | 2022-10-28 13:04:58 +0100 |
| commit | 02785b892c2203c08d49811cc67be2775c4e1f32 (patch) | |
| tree | 2b3259b2751333c62e20d57d04b304c10b002d80 /sound/soc/sof/intel/hda-mlink.c | |
| parent | f402a974aa0ae2b9abcccf49d5ac7c093e86a073 (diff) | |
ASoC: SOF: Intel: add hda_bus_ml_free helper
Add helper matching allocation done in hda_bus_ml_get_capabilities().
No functionality change, just clearer code partitioning.
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20221027193540.259520-19-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/sof/intel/hda-mlink.c')
| -rw-r--r-- | sound/soc/sof/intel/hda-mlink.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/sound/soc/sof/intel/hda-mlink.c b/sound/soc/sof/intel/hda-mlink.c index 2cdee03e4a47..76ab9a2e7bb3 100644 --- a/sound/soc/sof/intel/hda-mlink.c +++ b/sound/soc/sof/intel/hda-mlink.c @@ -34,6 +34,20 @@ void hda_bus_ml_get_capabilities(struct hdac_bus *bus) snd_hdac_ext_bus_get_ml_capabilities(bus); } +void hda_bus_ml_free(struct hdac_bus *bus) +{ + struct hdac_ext_link *hlink; + + if (!bus->mlcap) + return; + + while (!list_empty(&bus->hlink_list)) { + hlink = list_first_entry(&bus->hlink_list, struct hdac_ext_link, list); + list_del(&hlink->list); + kfree(hlink); + } +} + void hda_bus_ml_put_all(struct hdac_bus *bus) { struct hdac_ext_link *hlink; |
