[PATCH 2/2] ASoC: hisilicon: Disable clocks in reverse order

From: phucduc . bui

Date: Thu Oct 29 2026 - 04:01:44 EST


From: bui duc phuc <phucduc.bui@xxxxxxxxx>

Disable clocks in reverse order in hi6210_i2s_shutdown(), matching
the clock cleanup order in hi6210_i2s_startup().

Signed-off-by: bui duc phuc <phucduc.bui@xxxxxxxxx>
---
sound/soc/hisilicon/hi6210-i2s.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sound/soc/hisilicon/hi6210-i2s.c b/sound/soc/hisilicon/hi6210-i2s.c
index 1c9e235c3a81..7cede2689ed9 100644
--- a/sound/soc/hisilicon/hi6210-i2s.c
+++ b/sound/soc/hisilicon/hi6210-i2s.c
@@ -168,9 +168,9 @@ static void hi6210_i2s_shutdown(struct snd_pcm_substream *substream,
struct snd_soc_dai *cpu_dai)
{
struct hi6210_i2s *i2s = dev_get_drvdata(cpu_dai->dev);
- int n;
+ int n = i2s->clocks;

- for (n = 0; n < i2s->clocks; n++)
+ while (n--)
clk_disable_unprepare(i2s->clk[n]);

regmap_write(i2s->sysctrl, SC_PERIPH_RSTEN1, BIT(5));
--
2.43.0