Commit 8a55786a authored by Pierre-Louis Bossart's avatar Pierre-Louis Bossart Committed by Mark Brown

ASoC: SOF: Intel: hda-mlink: improve hda_bus_ml_free() helper

Use list_for_each_entry_safe() instead of open-coding.
Signed-off-by: default avatarPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: default avatarRander Wang <rander.wang@intel.com>
Reviewed-by: default avatarPéter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: default avatarRanjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: default avatarPeter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: default avatarTakashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/20230404104127.5629-4-peter.ujfalusi@linux.intel.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 34e582b5
...@@ -36,13 +36,12 @@ void hda_bus_ml_get_capabilities(struct hdac_bus *bus) ...@@ -36,13 +36,12 @@ void hda_bus_ml_get_capabilities(struct hdac_bus *bus)
void hda_bus_ml_free(struct hdac_bus *bus) void hda_bus_ml_free(struct hdac_bus *bus)
{ {
struct hdac_ext_link *hlink; struct hdac_ext_link *hlink, *_h;
if (!bus->mlcap) if (!bus->mlcap)
return; return;
while (!list_empty(&bus->hlink_list)) { list_for_each_entry_safe(hlink, _h, &bus->hlink_list, list) {
hlink = list_first_entry(&bus->hlink_list, struct hdac_ext_link, list);
list_del(&hlink->list); list_del(&hlink->list);
kfree(hlink); kfree(hlink);
} }
......
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