From 41ae5045e1f3c4eb39eaa59aab200d8d13dd0cd3 Mon Sep 17 00:00:00 2001 From: Seung-Woo Kim Date: Thu, 26 Dec 2024 18:25:12 +0900 Subject: [PATCH] ASoC: spacemit: Fix declaration error Some compilers give an error, "a label can only be part of a statement and a declaration is not a statement" for declaration in middle of statement. Fix the error by moving declaration to function top. Change-Id: I7635abf585e49582584b3e379326b8d1fa2f8a92 Signed-off-by: Seung-Woo Kim --- sound/soc/spacemit/spacemit-snd-i2s.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sound/soc/spacemit/spacemit-snd-i2s.c b/sound/soc/spacemit/spacemit-snd-i2s.c index 631d579867b8..12a6a9f878ab 100644 --- a/sound/soc/spacemit/spacemit-snd-i2s.c +++ b/sound/soc/spacemit/spacemit-snd-i2s.c @@ -255,13 +255,14 @@ static int i2s_sspa_trigger(struct snd_pcm_substream *substream, int cmd, struct sspa_priv *sspa_priv = snd_soc_dai_get_drvdata(dai); struct ssp_device *sspa = sspa_priv->sspa; int ret = 0; + unsigned int ssp_top_cfg = 0; pr_debug("%s cmd=%d, cnt=%d\n", __FUNCTION__, cmd, sspa_priv->running_cnt); switch (cmd) { case SNDRV_PCM_TRIGGER_START: case SNDRV_PCM_TRIGGER_RESUME: case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: - unsigned int ssp_top_cfg = i2s_sspa_read_reg(sspa, TOP_CTRL); + ssp_top_cfg = i2s_sspa_read_reg(sspa, TOP_CTRL); pr_debug("TOP_CTRL:0x%x", ssp_top_cfg); ssp_top_cfg |= TOP_SSE; i2s_sspa_write_reg(sspa, TOP_CTRL, ssp_top_cfg); //SSP_enable -- 2.34.1