Skip to contentSkip to conversation

ASoC: 88pm860x: Don't change pm860x->dir setting if pm860x_set_dai_sysclk fails

PATCH In review Axel Lin 3 participants 3 messages Jun 29, 2015 – Jul 7, 2015

Subsystems (2)
lore
Share & tools
lore

Axel Lin

author
#0 lore raw

PATCH 1/1 ASoC: 88pm860x: Don't change pm860x->dir setting if pm860x_set_dai_sysclk fails

88pm860x does not support slave mode, so it returns -EINVAL for PM860X_CLK_DIR_IN. Current code changes pm860x->dir setting before return error, so it has impact on the logic of pm860x_pcm_set_dai_fmt.

This patch adds comment for the reason to return -EINVAL for PM860X_CLK_DIR_IN, and avoid changing pm860x->dir setting if pm860x_set_dai_sysclk fails.

---
 sound/soc/codecs/88pm860x-codec.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
sound/soc/codecs/88pm860x-codec.c +1 -3
index 38b3dad..4d91a6a 100644
@@ -1028,10 +1028,8 @@ static int pm860x_set_dai_sysclk(struct snd_soc_dai *codec_dai,
 
 	if (dir == PM860X_CLK_DIR_OUT)
 		pm860x->dir = PM860X_CLK_DIR_OUT;
-	else {
-		pm860x->dir = PM860X_CLK_DIR_IN;
+	else	/* Slave mode is not supported */
 		return -EINVAL;
-	}
 
 	return 0;
 }
Signature · 1 line
2.1.0
Acked-by on v1 1/1
#1 lore raw
Quoted 19 lines · Axel Lin

88pm860x does not support slave mode, so it returns -EINVAL for PM860X_CLK_DIR_IN. Current code changes pm860x->dir setting before return error, so it has impact on the logic of pm860x_pcm_set_dai_fmt.

This patch adds comment for the reason to return -EINVAL for PM860X_CLK_DIR_IN, and avoid changing pm860x->dir setting if pm860x_set_dai_sysclk fails.

---
 sound/soc/codecs/88pm860x-codec.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
sound/soc/codecs/88pm860x-codec.c +0 -0
index 38b3dad..4d91a6a 100644
@@ -1028,10 +1028,8 @@ static int pm860x_set_dai_sysclk(struct snd_soc_dai *codec_dai,
 

sound/soc/codecs/88pm860x-codec.c static int pm860x_set_dai_sysclk(struct snd_soc_dai *codec_dai, · line 1035

Quoted 10 lines
sound/soc/codecs/88pm860x-codec.c +1 -3
 	if (dir == PM860X_CLK_DIR_OUT)
 		pm860x->dir = PM860X_CLK_DIR_OUT;
-	else {
-		pm860x->dir = PM860X_CLK_DIR_IN;
+	else	/* Slave mode is not supported */
 		return -EINVAL;
-	}
 
 	return 0;
 }

Regards
Haojian

maintainer
#2 lore raw

Applied "ASoC: 88pm860x: Don't change pm860x->dir setting if pm860x_set_dai_sysclk fails" to the asoc tree

In reply to Axel Lin

The patch

ASoC: 88pm860x: Don't change pm860x->dir setting if pm860x_set_dai_sysclk fails

has been applied to the asoc tree at

git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git

All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying to this mail.

Thanks,
Mark

Quoted 1 line

From 93ec3a1ad5b86aef8ca90d2b149ded0f6bb689f5 Mon Sep 17 00:00:00 2001

From: Axel Lin <[email protected]>
Date: Mon, 29 Jun 2015 11:15:23 +0800
Subject: [PATCH] ASoC: 88pm860x: Don't change pm860x->dir setting if
pm860x_set_dai_sysclk fails

88pm860x does not support slave mode, so it returns -EINVAL for PM860X_CLK_DIR_IN. Current code changes pm860x->dir setting before return error, so it has impact on the logic of pm860x_pcm_set_dai_fmt.

This patch adds comment for the reason to return -EINVAL for PM860X_CLK_DIR_IN, and avoid changing pm860x->dir setting if pm860x_set_dai_sysclk fails.

---
 sound/soc/codecs/88pm860x-codec.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
sound/soc/codecs/88pm860x-codec.c +1 -3
index 38b3dad..4d91a6a 100644
@@ -1028,10 +1028,8 @@ static int pm860x_set_dai_sysclk(struct snd_soc_dai *codec_dai,
 
 	if (dir == PM860X_CLK_DIR_OUT)
 		pm860x->dir = PM860X_CLK_DIR_OUT;
-	else {
-		pm860x->dir = PM860X_CLK_DIR_IN;
+	else	/* Slave mode is not supported */
 		return -EINVAL;
-	}
 
 	return 0;
 }
Signature · 1 line
2.1.4