Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

ASoC: loongson: Remove useless variable definitions

In the function loongson_pcm_trigger and loongson_pcm_open,
the 'ret' is useless, so remove it to simplify code.

Signed-off-by: tangbin <tangbin@cmss.chinamobile.com>
Link: https://patch.msgid.link/20240713153428.44858-1-tangbin@cmss.chinamobile.com
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

tangbin and committed by
Mark Brown
60b5c173 c8c3d9f8

+5 -10
+5 -10
sound/soc/loongson/loongson_dma.c
··· 95 95 struct device *dev = substream->pcm->card->dev; 96 96 void __iomem *order_reg = prtd->dma_data->order_addr; 97 97 u64 val; 98 - int ret = 0; 99 98 100 99 switch (cmd) { 101 100 case SNDRV_PCM_TRIGGER_START: ··· 128 129 return -EINVAL; 129 130 } 130 131 131 - return ret; 132 + return 0; 132 133 } 133 134 134 135 static int loongson_pcm_hw_params(struct snd_soc_component *component, ··· 229 230 struct snd_card *card = substream->pcm->card; 230 231 struct loongson_runtime_data *prtd; 231 232 struct loongson_dma_data *dma_data; 232 - int ret; 233 233 234 234 /* 235 235 * For mysterious reasons (and despite what the manual says) ··· 250 252 prtd->dma_desc_arr = dma_alloc_coherent(card->dev, PAGE_SIZE, 251 253 &prtd->dma_desc_arr_phy, 252 254 GFP_KERNEL); 253 - if (!prtd->dma_desc_arr) { 254 - ret = -ENOMEM; 255 + if (!prtd->dma_desc_arr) 255 256 goto desc_err; 256 - } 257 + 257 258 prtd->dma_desc_arr_size = PAGE_SIZE / sizeof(*prtd->dma_desc_arr); 258 259 259 260 prtd->dma_pos_desc = dma_alloc_coherent(card->dev, 260 261 sizeof(*prtd->dma_pos_desc), 261 262 &prtd->dma_pos_desc_phy, 262 263 GFP_KERNEL); 263 - if (!prtd->dma_pos_desc) { 264 - ret = -ENOMEM; 264 + if (!prtd->dma_pos_desc) 265 265 goto pos_err; 266 - } 267 266 268 267 dma_data = snd_soc_dai_get_dma_data(snd_soc_rtd_to_cpu(rtd, 0), substream); 269 268 prtd->dma_data = dma_data; ··· 274 279 desc_err: 275 280 kfree(prtd); 276 281 277 - return ret; 282 + return -ENOMEM; 278 283 } 279 284 280 285 static int loongson_pcm_close(struct snd_soc_component *component,