summaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/nau8825.c
diff options
context:
space:
mode:
authorCezary Rojewski <cezary.rojewski@intel.com>2022-10-27 10:58:40 +0200
committerMark Brown <broonie@kernel.org>2022-11-18 16:38:27 +0100
commitc7eb967d70446971413061effca3226578cb4dab (patch)
tree8ea7303efb23c892a869343c5bc669e5a178fbba /sound/soc/codecs/nau8825.c
parentASoC: mchp-spdiftx: add power saving features (diff)
downloadlinux-c7eb967d70446971413061effca3226578cb4dab.tar.xz
linux-c7eb967d70446971413061effca3226578cb4dab.zip
ASoC: core: Exit all links before removing their components
Flows leading to link->init() and link->exit() are not symmetric. Currently the relevant part of card probe sequence goes as: for_each_card_rtds(card, rtd) for_each_rtd_components(rtd, i, component) component->probe() for_each_card_rtds(card, rtd) for_each_rtd_dais(rtd, i, dai) dai->probe() for_each_card_rtds(card, rtd) rtd->init() On the other side, equivalent remove sequence goes as: for_each_card_rtds(card, rtd) for_each_rtd_dais(rtd, i, dai) dai->remove() for_each_card_rtds(card, rtd) for_each_rtd_components(rtd, i, component) component->remove() for_each_card_rtds(card, rtd) rtd->exit() what can lead to errors as link->exit() may still operate on resources owned by its components despite the probability of them being freed during the component->remove(). This change modifies the remove sequence to: for_each_card_rtds(card, rtd) rtd->exit() for_each_card_rtds(card, rtd) for_each_rtd_dais(rtd, i, dai) dai->remove() for_each_card_rtds(card, rtd) for_each_rtd_components(rtd, i, component) component->remove() so code found in link->exit() is safe to touch any component stuff as component->remove() has not been called yet. Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com> Reviewed-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com> Link: https://lore.kernel.org/r/20221027085840.1562698-1-cezary.rojewski@intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/codecs/nau8825.c')
0 files changed, 0 insertions, 0 deletions