]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
ASoC: rockchip: i2s-tdm: Fix a useless call issue
authorDheeraj Reddy Jonnalagadda <dheeraj.linuxdev@gmail.com>
Mon, 18 Nov 2024 04:56:05 +0000 (10:26 +0530)
committerMark Brown <broonie@kernel.org>
Mon, 2 Dec 2024 00:30:38 +0000 (00:30 +0000)
This commit fixes a useless call issue detected by Coverity
(CID 1507978). The call to rockchip_i2s_ch_to_io is unnecessary as its
return value is never checked or used. As a result, the function
definition and call is removed.

Signed-off-by: Dheeraj Reddy Jonnalagadda <dheeraj.linuxdev@gmail.com>
Link: https://patch.msgid.link/20241118045605.48440-1-dheeraj.linuxdev@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/rockchip/rockchip_i2s_tdm.c

index d1f28699652fe3d2f289bf7c05781bb434132cb7..bd0dc586e24a3c80d4883e123d9314fc0a37060f 100644 (file)
@@ -514,33 +514,6 @@ static void rockchip_i2s_tdm_xfer_resume(struct snd_pcm_substream *substream,
                           I2S_XFER_RXS_START);
 }
 
-static int rockchip_i2s_ch_to_io(unsigned int ch, bool substream_capture)
-{
-       if (substream_capture) {
-               switch (ch) {
-               case I2S_CHN_4:
-                       return I2S_IO_6CH_OUT_4CH_IN;
-               case I2S_CHN_6:
-                       return I2S_IO_4CH_OUT_6CH_IN;
-               case I2S_CHN_8:
-                       return I2S_IO_2CH_OUT_8CH_IN;
-               default:
-                       return I2S_IO_8CH_OUT_2CH_IN;
-               }
-       } else {
-               switch (ch) {
-               case I2S_CHN_4:
-                       return I2S_IO_4CH_OUT_6CH_IN;
-               case I2S_CHN_6:
-                       return I2S_IO_6CH_OUT_4CH_IN;
-               case I2S_CHN_8:
-                       return I2S_IO_8CH_OUT_2CH_IN;
-               default:
-                       return I2S_IO_2CH_OUT_8CH_IN;
-               }
-       }
-}
-
 static int rockchip_i2s_io_multiplex(struct snd_pcm_substream *substream,
                                     struct snd_soc_dai *dai)
 {
@@ -577,7 +550,6 @@ static int rockchip_i2s_io_multiplex(struct snd_pcm_substream *substream,
                        return -EINVAL;
                }
 
-               rockchip_i2s_ch_to_io(val, true);
        } else {
                struct snd_pcm_str *capture_str =
                        &substream->pcm->streams[SNDRV_PCM_STREAM_CAPTURE];