From patchwork Mon Jun 29 03:15:23 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Axel Lin X-Patchwork-Id: 6687181 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 9BAB2C05AC for ; Mon, 29 Jun 2015 03:15:49 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D4A9F204E4 for ; Mon, 29 Jun 2015 03:15:48 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 63CCB204E1 for ; Mon, 29 Jun 2015 03:15:47 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 014C92651D1; Mon, 29 Jun 2015 05:15:46 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-0.2 required=5.0 tests=BAYES_00, SUBJ_OBFU_PUNCT_MANY, UNPARSEABLE_RELAY autolearn=no version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id 30FDB265192; Mon, 29 Jun 2015 05:15:38 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id D34842651A9; Mon, 29 Jun 2015 05:15:36 +0200 (CEST) Received: from mail-pd0-f176.google.com (mail-pd0-f176.google.com [209.85.192.176]) by alsa0.perex.cz (Postfix) with ESMTP id 9F5D9265191 for ; Mon, 29 Jun 2015 05:15:29 +0200 (CEST) Received: by pdcu2 with SMTP id u2so108330983pdc.3 for ; Sun, 28 Jun 2015 20:15:28 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:subject:from:to:cc:date:content-type :mime-version:content-transfer-encoding; bh=isP9MaqQ/2dROfBB2R4JVwMi8PaXg0WA1AOTyUA545s=; b=Yy0oMorH2dwlM+0nUNISGdedpczC+DizNvbZyOXpje84ITm+6XpsrNbvx+v1VDtVKi tRRwv7y+jw+hTmtuXQYHQfyIp6OHeH6pGvx2vxicDm6Biu+tDIVi3M3/dbj8t/2YdFLU zrh2SiKTn3PIHHeSPtPxsV6K4fdJSEZU2Ek2BdTs5+Z1ngmDXm2Me2VtR7LSwC3Zlq/z VAyQC2qDZgrKh0OrmU0yhzGjnByaMHAcMrWFcJJzDcQZ6OzfGb1d4GqkL5PNo4A+/yBB evSjAKdQFS1T4MS77QvBcDJfj943eHeOQJ6NxaczJU3VbB/wuStO97tovOWctQJjpm6I ZHpw== X-Gm-Message-State: ALoCoQn9MRua61WerGCGez7rshaFGpKAsK1PgcaDrqPDA40x5wkYqn11D7ePhfeJNlSg/VG2f/eI X-Received: by 10.70.41.33 with SMTP id c1mr27365392pdl.114.1435547728130; Sun, 28 Jun 2015 20:15:28 -0700 (PDT) Received: from phoenix.local (118-171-140-116.dynamic.hinet.net. [118.171.140.116]) by mx.google.com with ESMTPSA id v8sm40437628pdm.89.2015.06.28.20.15.25 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 28 Jun 2015 20:15:27 -0700 (PDT) Message-ID: <1435547723.6397.1.camel@ingics.com> From: Axel Lin To: Mark Brown Date: Mon, 29 Jun 2015 11:15:23 +0800 X-Mailer: Evolution 3.12.10-0ubuntu1~14.10.1 Mime-Version: 1.0 Cc: alsa-devel@alsa-project.org, Haojian Zhuang , Liam Girdwood Subject: [alsa-devel] [PATCH] ASoC: 88pm860x: Don't change pm860x->dir setting if pm860x_set_dai_sysclk fails X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Acked-by: Haojian Zhuang --- 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; }