ASoC: spacemit: Fix declaration error 75/317175/1
authorSeung-Woo Kim <sw0312.kim@samsung.com>
Thu, 26 Dec 2024 09:25:12 +0000 (18:25 +0900)
committerSeung-Woo Kim <sw0312.kim@samsung.com>
Thu, 26 Dec 2024 09:28:03 +0000 (18:28 +0900)
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 <sw0312.kim@samsung.com>
sound/soc/spacemit/spacemit-snd-i2s.c

index 631d579867b8d7c39259e3304b46424ab4b9614a..12a6a9f878abdaa30bb3d16067f17a801414c85c 100644 (file)
@@ -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