Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp272232pxx; Thu, 29 Oct 2020 02:09:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzIsAQbxczyYxCTcDYNsuz4Kj6HnnjvGHu1ujq4I1s1T0EnGeCXe64QKWS7LQkyoIFMN/Qc X-Received: by 2002:a17:906:9247:: with SMTP id c7mr3169608ejx.324.1603962544789; Thu, 29 Oct 2020 02:09:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603962544; cv=none; d=google.com; s=arc-20160816; b=krRqmREN7RuoJWpCQmls7hgFmDiwTsv3FLw/9v1EgNH9eKU+UORI0rRzAUk03tgVRw znEob235SYK7esTFExRRruWHQ2kfiOOGwl0R2CfWWbPOmlVt/eQcLsI87/hl4Bzz4bjo b6eOOLeCOmlftWZS398PemiqJXUrakXmkcrnCllz+UWbFsmvBO8Q+AIPu4bJoZltApLq jUSbsoxtcUmH3tUgshlrqTrSdrIMuV+6ErMeGDGx5H+RrD5WWRgXhqqOrsWbHNMoBQLn DwVOdNVpQrSA+JOgefdDgzFlw2myJTcvmMKSzO1OpOQvmgU/GQwxIERAyGs+ZnXy1yE6 d1xw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from; bh=G88LYGHE4V1QhWqJuRZXH00GzBpQa5m9AkVjIcI/hP8=; b=L1ADWWfiyM6enz5wdCoNQQNAAn8RSwHEoz3xZIPfCGrxybJMv7KDa+OgtfGATqfyEV tQqPum+CH3opbL1hXSZp/HeZWU3EZLUvoGm+xJAT9coSRujd4uCT/xCmfTcbwW4R9x2j llP5csi6k9FhgE1UHuwbb/2NrluoOFcqcF6ZmobXXecsVZQTa2O4dumYb53CabDM4Eg6 wsy2gQ0cQIG8QEdwFfeYJOGiUJrHJQkvP9cGMU2yCxWmy2iZiA315/4JDirlMsgFoT0H rdiLDUgf2onlivP3wXNC8xx/ZCcD5ubH0rUDKOr5SkFf/WMfMIRtOaHK6ZuNL+SyCmCE NvrQ== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e24si1418603ejh.243.2020.10.29.02.08.41; Thu, 29 Oct 2020 02:09:04 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725897AbgJ2JCL (ORCPT + 99 others); Thu, 29 Oct 2020 05:02:11 -0400 Received: from smtp25.cstnet.cn ([159.226.251.25]:41378 "EHLO cstnet.cn" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726069AbgJ2JBd (ORCPT ); Thu, 29 Oct 2020 05:01:33 -0400 Received: from localhost.localdomain (unknown [124.16.141.242]) by APP-05 (Coremail) with SMTP id zQCowAAn_1LUhJpfva5LAA--.30207S2; Thu, 29 Oct 2020 17:01:08 +0800 (CST) From: Xu Wang To: daniel@zonque.org, haojian.zhuang@gmail.com, robert.jarzmik@free.fr, lgirdwood@gmail.com, broonie@kernel.org, perex@perex.cz, tiwai@suse.com, linux-arm-kernel@lists.infradead.org, alsa-devel@alsa-project.org Cc: linux-kernel@vger.kernel.org Subject: [PATCH] ASoC: pxa: pxa-ssp: Remove redundant null check before clk_prepare_enable/clk_disable_unprepare Date: Thu, 29 Oct 2020 09:01:04 +0000 Message-Id: <20201029090104.29552-1-vulab@iscas.ac.cn> X-Mailer: git-send-email 2.17.1 X-CM-TRANSID: zQCowAAn_1LUhJpfva5LAA--.30207S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U4iF4DUUUU X-Originating-IP: [124.16.141.242] X-CM-SenderInfo: pyxotu46lvutnvoduhdfq/1tbiCQUEA102ZrAgaAAAs+ Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org ecause clk_prepare_enable() and clk_disable_unprepare() already checked NULL clock parameter, so the additional checks are unnecessary, just remove them. Signed-off-by: Xu Wang --- sound/soc/pxa/pxa-ssp.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/sound/soc/pxa/pxa-ssp.c b/sound/soc/pxa/pxa-ssp.c index c4e7307a4437..b941adcbb8f9 100644 --- a/sound/soc/pxa/pxa-ssp.c +++ b/sound/soc/pxa/pxa-ssp.c @@ -99,8 +99,7 @@ static int pxa_ssp_startup(struct snd_pcm_substream *substream, pxa_ssp_disable(ssp); } - if (priv->extclk) - clk_prepare_enable(priv->extclk); + clk_prepare_enable(priv->extclk); dma = kzalloc(sizeof(struct snd_dmaengine_dai_dma_data), GFP_KERNEL); if (!dma) @@ -124,8 +123,7 @@ static void pxa_ssp_shutdown(struct snd_pcm_substream *substream, clk_disable_unprepare(ssp->clk); } - if (priv->extclk) - clk_disable_unprepare(priv->extclk); + clk_disable_unprepare(priv->extclk); kfree(snd_soc_dai_get_dma_data(cpu_dai, substream)); snd_soc_dai_set_dma_data(cpu_dai, substream, NULL); -- 2.17.1