From patchwork Sat Jun 20 18:55:53 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 6651541 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 9EAF2C05AC for ; Sat, 20 Jun 2015 18:58:12 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D65892063A for ; Sat, 20 Jun 2015 18:58:11 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 9A9A920614 for ; Sat, 20 Jun 2015 18:58:10 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id B535A2607E8; Sat, 20 Jun 2015 20:58:09 +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 2A16E2612DF; Sat, 20 Jun 2015 20:56:57 +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 3EDB22612DF; Sat, 20 Jun 2015 20:56:55 +0200 (CEST) Received: from mail-qg0-f54.google.com (mail-qg0-f54.google.com [209.85.192.54]) by alsa0.perex.cz (Postfix) with ESMTP id A1302260713 for ; Sat, 20 Jun 2015 20:56:22 +0200 (CEST) Received: by qgal13 with SMTP id l13so44539642qga.3 for ; Sat, 20 Jun 2015 11:56:21 -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:in-reply-to:references; bh=V7P4flA6HTyEETinJDrELjoI6zun/JnBNiznbytoils=; b=HuHORHL0y57Kd5vRjuZFBCHd02FjnDO61nDYlE4TGPAdHSCcKMSuAXQZrld5iMyxg8 /zcxDmiIv//ixNdrgmU0sMfsYF3+h7BS2s5CqOI4UFaF4OmK6UEw3jjoel2/AWGcGaIT NCvpGyTbAB2KjlE/Sn6o0lUW7oOfU+cEaJebmUFSjXkEIRRu9fRZYy6o/50UQnKrn0cS C9fPSJlGEbz++gGz/rPJpCxxR9PieUQ9Pi9WVXO9an4cO2VXPS6hVFxixS0je//YjeVP 84j8nQdVbIMKmSfWac8daalxow1SsJ+ZZ6XMFlPyYfwaDB8CSDaQxyJqBOjH/KqB58rg AM0A== X-Received: by 10.55.18.27 with SMTP id c27mr40450302qkh.84.1434826581934; Sat, 20 Jun 2015 11:56:21 -0700 (PDT) Received: from localhost.localdomain ([189.101.187.123]) by mx.google.com with ESMTPSA id x66sm7584066qha.8.2015.06.20.11.56.18 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 20 Jun 2015 11:56:21 -0700 (PDT) From: Fabio Estevam To: broonie@kernel.org Date: Sat, 20 Jun 2015 15:55:53 -0300 Message-Id: <1434826553-11484-4-git-send-email-festevam@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1434826553-11484-1-git-send-email-festevam@gmail.com> References: <1434826553-11484-1-git-send-email-festevam@gmail.com> Cc: Fabio Estevam , alsa-devel@alsa-project.org Subject: [alsa-devel] [PATCH 4/4] ASoC: max98095: 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/max98095.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/sound/soc/codecs/max98095.c b/sound/soc/codecs/max98095.c index 9a46d3d..66afd2b 100644 --- a/sound/soc/codecs/max98095.c +++ b/sound/soc/codecs/max98095.c @@ -1653,10 +1653,13 @@ static int max98095_set_bias_level(struct snd_soc_codec *codec, if (IS_ERR(max98095->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(max98095->mclk); - else - clk_prepare_enable(max98095->mclk); + } else { + ret = clk_prepare_enable(max98095->mclk); + if (ret) + return ret; + } break; case SND_SOC_BIAS_STANDBY: