[alsa-devel] [PATCH] ASoC: fsl-sai: Clean up the code

Xiubo Li Li.Xiubo at freescale.com
Wed Jan 8 09:13:05 CET 2014


Makes the code slightly shorter.

Signed-off-by: Xiubo Li <Li.Xiubo at freescale.com>
---
 sound/soc/fsl/fsl_sai.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/sound/soc/fsl/fsl_sai.c b/sound/soc/fsl/fsl_sai.c
index 5d38a67..cdd3fa8 100644
--- a/sound/soc/fsl/fsl_sai.c
+++ b/sound/soc/fsl/fsl_sai.c
@@ -62,26 +62,25 @@ static int fsl_sai_set_dai_sysclk_tr(struct snd_soc_dai *cpu_dai,
 		reg_cr2 = FSL_SAI_RCR2;
 
 	val_cr2 = sai_readl(sai, sai->base + reg_cr2);
+	val_cr2 &= ~FSL_SAI_CR2_MSEL_MASK;
+
 	switch (clk_id) {
 	case FSL_SAI_CLK_BUS:
-		val_cr2 &= ~FSL_SAI_CR2_MSEL_MASK;
 		val_cr2 |= FSL_SAI_CR2_MSEL_BUS;
 		break;
 	case FSL_SAI_CLK_MAST1:
-		val_cr2 &= ~FSL_SAI_CR2_MSEL_MASK;
 		val_cr2 |= FSL_SAI_CR2_MSEL_MCLK1;
 		break;
 	case FSL_SAI_CLK_MAST2:
-		val_cr2 &= ~FSL_SAI_CR2_MSEL_MASK;
 		val_cr2 |= FSL_SAI_CR2_MSEL_MCLK2;
 		break;
 	case FSL_SAI_CLK_MAST3:
-		val_cr2 &= ~FSL_SAI_CR2_MSEL_MASK;
 		val_cr2 |= FSL_SAI_CR2_MSEL_MCLK3;
 		break;
 	default:
 		return -EINVAL;
 	}
+
 	sai_writel(sai, val_cr2, sai->base + reg_cr2);
 
 	return 0;
-- 
1.8.4




More information about the Alsa-devel mailing list