Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp3346755ybt; Mon, 22 Jun 2020 23:17:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwEprt0bvArF5lcMVoIlY5VPNtNdwOh45K9DWdk8p20IG6lLPLuc6x77O5Q7DNb2irluW88 X-Received: by 2002:a17:906:88d:: with SMTP id n13mr5672690eje.349.1592893068610; Mon, 22 Jun 2020 23:17:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592893068; cv=none; d=google.com; s=arc-20160816; b=qEurw97OBLkQEYDYDg+pJN28HcljyWohc4d1T12Z/e9RqIw840A/BKTyNnggapFvRE OpzFCeFgdkD/TJbfSUV6W4UtMQyYhBop0x3nRZmrffBceHFE8xjbP+Yvsfj21d5Bdp8x 3vOeUiozKFFCJV+b058oETBEvkxFHd5JVxAqpczWveVxEA0w/pr/EzyezWq/LvOLUVwb BNGROb5H+SD+yvG6pTG6eEL9JS8Jzh9Z8CWlivKgwIlwe+grWNMniLmnl6tGFM7kivaN QiTme0Dq7zsrmipd7BZ0Kno2ChE3w7wHJKcNBLpqFE+KFdd67bD0r9BEB5psAmuiR5RY mRhQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:cc:to:from; bh=7oe6jWan4UE/Cp4I7zVChLZugFk2b+mPBOtswCExpV0=; b=n30gxHRUCW6nY5LDVWqEN4dJvE43bgeFmUF7RoPo5b9xOmfXkWxpBpKZos1puaTbIb 5LoxIJQS5sO+d/Q86c7nIHUFsuzY/7OkjHhwKr0Aq/LT2cYVENYW6aK5VOh3DL1Hf4iq 3Zv+wLkfA50QTdRosxjsl6sVdEo9Y1oCNdJ8vhdJF8pKr3Nl7UpSfErdytd94kF5Zf2+ DlzVdXtJ7OWO/barkY/sx3iIhfxFVyxakgEO4oraE7Op3nfWA8KT7VVdXjbJRvtxGyt3 /l5XwN4ebMviTL4JjpHAi6OJhZVN9DmZJ1UASqXthM7DLWAG17H42QWJdLqg1wD+0844 C9DA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dp17si13852654ejc.285.2020.06.22.23.17.26; Mon, 22 Jun 2020 23:17:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730495AbgFWGMp (ORCPT + 99 others); Tue, 23 Jun 2020 02:12:45 -0400 Received: from inva020.nxp.com ([92.121.34.13]:39166 "EHLO inva020.nxp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730149AbgFWGMl (ORCPT ); Tue, 23 Jun 2020 02:12:41 -0400 Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id D437B1A0E20; Tue, 23 Jun 2020 08:12:39 +0200 (CEST) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id A238C1A0090; Tue, 23 Jun 2020 08:12:35 +0200 (CEST) Received: from localhost.localdomain (shlinux2.ap.freescale.net [10.192.224.44]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 2C7D9402DB; Tue, 23 Jun 2020 14:12:30 +0800 (SGT) From: Shengjiu Wang To: timur@kernel.org, nicoleotsuka@gmail.com, Xiubo.Lee@gmail.com, festevam@gmail.com, broonie@kernel.org, perex@perex.cz, tiwai@suse.com, alsa-devel@alsa-project.org Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 2/2] ASoC: fsl_mqs: Fix unchecked return value for clk_prepare_enable Date: Tue, 23 Jun 2020 14:01:12 +0800 Message-Id: <5edd68d03def367d96268f1a9a00bd528ea5aaf2.1592888591.git.shengjiu.wang@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: References: In-Reply-To: References: X-Virus-Scanned: ClamAV using ClamSMTP Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Fix unchecked return value for clk_prepare_enable, add error handler in fsl_mqs_runtime_resume. Fixes: 9e28f6532c61 ("ASoC: fsl_mqs: Add MQS component driver") Signed-off-by: Shengjiu Wang --- sound/soc/fsl/fsl_mqs.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/sound/soc/fsl/fsl_mqs.c b/sound/soc/fsl/fsl_mqs.c index b44b134390a3..69aeb0e71844 100644 --- a/sound/soc/fsl/fsl_mqs.c +++ b/sound/soc/fsl/fsl_mqs.c @@ -265,10 +265,20 @@ static int fsl_mqs_remove(struct platform_device *pdev) static int fsl_mqs_runtime_resume(struct device *dev) { struct fsl_mqs *mqs_priv = dev_get_drvdata(dev); + int ret; - clk_prepare_enable(mqs_priv->ipg); + ret = clk_prepare_enable(mqs_priv->ipg); + if (ret) { + dev_err(dev, "failed to enable ipg clock\n"); + return ret; + } - clk_prepare_enable(mqs_priv->mclk); + ret = clk_prepare_enable(mqs_priv->mclk); + if (ret) { + dev_err(dev, "failed to enable mclk clock\n"); + clk_disable_unprepare(mqs_priv->ipg); + return ret; + } if (mqs_priv->use_gpr) regmap_write(mqs_priv->regmap, IOMUXC_GPR2, -- 2.21.0