Message ID | 1435547723.6397.1.camel@ingics.com (mailing list archive) |
---|---|
State | Accepted |
Commit | 93ec3a1ad5b86aef8ca90d2b149ded0f6bb689f5 |
Headers | show |
On Mon, 2015-06-29 at 11:15 +0800, Axel Lin wrote: > 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. > > Signed-off-by: Axel Lin <axel.lin@ingics.com> > --- > sound/soc/codecs/88pm860x-codec.c | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) > > diff --git a/sound/soc/codecs/88pm860x-codec.c b/sound/soc/codecs/88pm860x-codec.c > index 38b3dad..4d91a6a 100644 > --- a/sound/soc/codecs/88pm860x-codec.c > +++ b/sound/soc/codecs/88pm860x-codec.c > @@ -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; > } Acked-by: Haojian Zhuang <haojian.zhuang@linaro.org> Regards Haojian
diff --git a/sound/soc/codecs/88pm860x-codec.c b/sound/soc/codecs/88pm860x-codec.c index 38b3dad..4d91a6a 100644 --- a/sound/soc/codecs/88pm860x-codec.c +++ b/sound/soc/codecs/88pm860x-codec.c @@ -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; }
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. Signed-off-by: Axel Lin <axel.lin@ingics.com> --- sound/soc/codecs/88pm860x-codec.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)