Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp3345492ybt; Mon, 22 Jun 2020 23:15:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwzFIhsZA8fgEvkM9hmAtPi1ZjdM3QR48vF/Do6fAhqQ2alGeV7RqCptmxcE4w73QaGvLR4 X-Received: by 2002:a17:906:a01:: with SMTP id w1mr19240236ejf.197.1592892922651; Mon, 22 Jun 2020 23:15:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592892922; cv=none; d=google.com; s=arc-20160816; b=EwtuamXHODiv2RTOXSItiYSdtY0DVxDFVij8ve2u3BBOMrf3qzNQhQCXnKUXkmDHy1 Cn9OnTQScQ2BVyF1PZreDSNBE/BUQPgUKKobT0seDPpKwjgbwVg+ZLnyN6umo5nSb5N5 ZDALGmOePTsNd9YYjU0LhZlUlNOdCnreyRbVsqOy6AeWQ8OSyXaUcWL9d003xnWreihM mFj3DHyOiSjBpLu1ENoT/FzFWmSW5JrAfxEMoihq7Lke6pJdLnD/4/SUGD7adoQUUYgq 2YMp1AZX6bDkwTOnmvDUGEVulMFHgZrwSp6xmVSk72oouMpsJ2fac8YrxgKrx4SzvhqD iz2w== 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=pA428U7Tr9kiMWeDa1H/R1/PMIJU4d0p7TEzGI4rc/4=; b=hsL6CN2h7szx4Xj0jlbdBFCwF/3qkHLamJZbUfKvpIuvKNQub9o3pCajyijd4GgOnq xr2XkcjgST2oCAQSrGCMAnts72UuF9yOufIcoRiSwOf40hTNW+YTljs/UyfmfimtDfQ7 13MvOiiV1jLw0iyntFrxUciq1RKKA1MpKXJCXibUig+o6utTYfzQcUXyboAV6mEqefru +CawRESwAQqOpvHmLX1yphzgvGE7QTYcWgyPwDTvr63EgYfhO3JWJye5IR7NIP/2aLRD g5wXrKA8jf94I3/67U+1zYQC+KywWWii4OuP6KawhcCTdxGhSjq2HiGJcaFuasSRDozE vQlw== 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 j21si10257526ejm.613.2020.06.22.23.14.59; Mon, 22 Jun 2020 23:15:22 -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 S1730684AbgFWGMl (ORCPT + 99 others); Tue, 23 Jun 2020 02:12:41 -0400 Received: from inva021.nxp.com ([92.121.34.21]:39580 "EHLO inva021.nxp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730361AbgFWGMk (ORCPT ); Tue, 23 Jun 2020 02:12:40 -0400 Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id BE480200BD4; Tue, 23 Jun 2020 08:12:38 +0200 (CEST) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 94DE6200BDB; Tue, 23 Jun 2020 08:12:34 +0200 (CEST) Received: from localhost.localdomain (shlinux2.ap.freescale.net [10.192.224.44]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 2080A402B3; Tue, 23 Jun 2020 14:12:29 +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 1/2] ASoC: fsl_mqs: Don't check clock is NULL before calling clk API Date: Tue, 23 Jun 2020 14:01:11 +0800 Message-Id: <743be216bd504c26e8d45d5ce4a84561b67a122b.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 Because clk_prepare_enable and clk_disable_unprepare should check input clock parameter is NULL or not internally, then we don't need to check them before calling the function. Fixes: 9e28f6532c61 ("ASoC: fsl_mqs: Add MQS component driver") Signed-off-by: Shengjiu Wang --- sound/soc/fsl/fsl_mqs.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/sound/soc/fsl/fsl_mqs.c b/sound/soc/fsl/fsl_mqs.c index 0c813a45bba7..b44b134390a3 100644 --- a/sound/soc/fsl/fsl_mqs.c +++ b/sound/soc/fsl/fsl_mqs.c @@ -266,11 +266,9 @@ static int fsl_mqs_runtime_resume(struct device *dev) { struct fsl_mqs *mqs_priv = dev_get_drvdata(dev); - if (mqs_priv->ipg) - clk_prepare_enable(mqs_priv->ipg); + clk_prepare_enable(mqs_priv->ipg); - if (mqs_priv->mclk) - clk_prepare_enable(mqs_priv->mclk); + clk_prepare_enable(mqs_priv->mclk); if (mqs_priv->use_gpr) regmap_write(mqs_priv->regmap, IOMUXC_GPR2, @@ -292,11 +290,8 @@ static int fsl_mqs_runtime_suspend(struct device *dev) regmap_read(mqs_priv->regmap, REG_MQS_CTRL, &mqs_priv->reg_mqs_ctrl); - if (mqs_priv->mclk) - clk_disable_unprepare(mqs_priv->mclk); - - if (mqs_priv->ipg) - clk_disable_unprepare(mqs_priv->ipg); + clk_disable_unprepare(mqs_priv->mclk); + clk_disable_unprepare(mqs_priv->ipg); return 0; } -- 2.21.0