diff options
author | Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> | 2023-04-04 13:41:12 +0300 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2023-04-06 18:45:35 +0300 |
commit | 8a55786a1875bd0b9c22156e800557a931baacb8 (patch) | |
tree | fc6863701b39e56d27a2ba0f85a2f13fad336772 /sound | |
parent | 34e582b559c78746c544442b3925554e0665351b (diff) | |
download | linux-8a55786a1875bd0b9c22156e800557a931baacb8.tar.xz |
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 <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/20230404104127.5629-4-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/soc/sof/intel/hda-mlink.c | 5 |
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); } |