aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre-Louis Bossart <[email protected]>2023-04-04 13:41:12 +0300
committerMark Brown <[email protected]>2023-04-06 16:45:35 +0100
commit8a55786a1875bd0b9c22156e800557a931baacb8 (patch)
treefc6863701b39e56d27a2ba0f85a2f13fad336772
parent34e582b559c78746c544442b3925554e0665351b (diff)
ASoC: SOF: Intel: hda-mlink: improve hda_bus_ml_free() helper
Use list_for_each_entry_safe() instead of open-coding. Signed-off-by: Pierre-Louis Bossart <[email protected]> Reviewed-by: Rander Wang <[email protected]> Reviewed-by: Péter Ujfalusi <[email protected]> Reviewed-by: Ranjani Sridharan <[email protected]> Signed-off-by: Peter Ujfalusi <[email protected]> Reviewed-by: Takashi Iwai <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
-rw-r--r--sound/soc/sof/intel/hda-mlink.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/sound/soc/sof/intel/hda-mlink.c b/sound/soc/sof/intel/hda-mlink.c
index 76ab9a2e7bb3..ac9bf477f413 100644
--- a/sound/soc/sof/intel/hda-mlink.c
+++ b/sound/soc/sof/intel/hda-mlink.c
@@ -36,13 +36,12 @@ void hda_bus_ml_get_capabilities(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)
return;
- while (!list_empty(&bus->hlink_list)) {
- hlink = list_first_entry(&bus->hlink_list, struct hdac_ext_link, list);
+ list_for_each_entry_safe(hlink, _h, &bus->hlink_list, list) {
list_del(&hlink->list);
kfree(hlink);
}