From patchwork Sat Jun 20 18:55:50 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 6651511 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id A0B499F39B for ; Sat, 20 Jun 2015 18:56:31 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C80F0206FF for ; Sat, 20 Jun 2015 18:56:30 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 77561206FA for ; Sat, 20 Jun 2015 18:56:29 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 863FA2608EC; Sat, 20 Jun 2015 20:56:28 +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=-1.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=no version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id 9772C26074D; Sat, 20 Jun 2015 20:56:20 +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 6A1A1260786; Sat, 20 Jun 2015 20:56:19 +0200 (CEST) Received: from mail-qg0-f48.google.com (mail-qg0-f48.google.com [209.85.192.48]) by alsa0.perex.cz (Postfix) with ESMTP id 464B8260719 for ; Sat, 20 Jun 2015 20:56:12 +0200 (CEST) Received: by qged89 with SMTP id d89so44629174qge.0 for ; Sat, 20 Jun 2015 11:56:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=Y3WCiv8JI8PCF7+wJ300okyHD5US4yYw4g/OJEBUz/4=; b=vbEKzQineY5PUJqqrKuMILwZDgqOL8LkEB/wyE5IlZ561IATRIjzezjM+UT2rF+lNf 8RI+AnWinu4/Rzt24rEtWtLYtFQeS7c2g3nvfPj11hjoTNyrVQK8f7oBJHbjlQLlwEn/ rYrnQj5Sk4NUWQaaKFDU8UrADoQrkYiu5a1zENi1F7dQ2qBt2XXVZt53LEDaixkOyG0O /koDk6gKnq2dBrm1ud8DdAhcKpAX+0rpEqT/ndJIGX9Zgf/ti0ea8XNaeJu62mVhXF+p ea6V0v1z2nwsFBKM+GgB8FuDbxWJq1Yc7yh0y16vZyh2QqD0OvSf9y7+iCvaeOSHYjAr NPAg== X-Received: by 10.140.95.85 with SMTP id h79mr28535544qge.68.1434826571540; Sat, 20 Jun 2015 11:56:11 -0700 (PDT) Received: from localhost.localdomain ([189.101.187.123]) by mx.google.com with ESMTPSA id x66sm7584066qha.8.2015.06.20.11.56.08 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 20 Jun 2015 11:56:10 -0700 (PDT) From: Fabio Estevam To: broonie@kernel.org Date: Sat, 20 Jun 2015 15:55:50 -0300 Message-Id: <1434826553-11484-1-git-send-email-festevam@gmail.com> X-Mailer: git-send-email 1.9.1 Cc: Fabio Estevam , alsa-devel@alsa-project.org Subject: [alsa-devel] [PATCH 1/4] ASoC: max98090: Check for clk_prepare_enable() error 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: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP From: Fabio Estevam clk_prepare_enable() may fail, so we should better check its return value and propagate it in the case of error. Signed-off-by: Fabio Estevam --- sound/soc/codecs/max98090.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/sound/soc/codecs/max98090.c b/sound/soc/codecs/max98090.c index 78268f05..1697340 100644 --- a/sound/soc/codecs/max98090.c +++ b/sound/soc/codecs/max98090.c @@ -1801,10 +1801,13 @@ static int max98090_set_bias_level(struct snd_soc_codec *codec, if (IS_ERR(max98090->mclk)) break; - if (snd_soc_codec_get_bias_level(codec) == SND_SOC_BIAS_ON) + if (snd_soc_codec_get_bias_level(codec) == SND_SOC_BIAS_ON) { clk_disable_unprepare(max98090->mclk); - else - clk_prepare_enable(max98090->mclk); + } else { + ret = clk_prepare_enable(max98090->mclk); + if (ret) + return ret; + } break; case SND_SOC_BIAS_STANDBY: