From patchwork Thu Oct 29 09:01:04 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xu Wang X-Patchwork-Id: 11865707 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A92A1C2D0A3 for ; Thu, 29 Oct 2020 09:06:16 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1483D206D9 for ; Thu, 29 Oct 2020 09:06:15 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="atIuGfv9" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1483D206D9 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=iscas.ac.cn Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:MIME-Version:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Owner; bh=1BPI8CC3dKbwfvVkBk1v9wFxALxpEU3hayE+L1Agm4o=; b=atIuGfv9x2IZwcRY0ERDqukfai Jfpx7TNYaQ9AsiAsOn9BPRjCLZoJP+CQ5nJoYNXSrWc4So1EmEKFHUTAufINFrwKKv9IigQnpRnot jKpuhymOk9H0vIGIB9mYJdqM9M+qNj6mzkj9SDlQfMeERQjtX1W/Dx4iHlQYsK4mpgtkFyCTHTbaO zcQfcNWmTC49Mj8XJ0LRktSr3+GIAZpWFdUP+M5w9jp+ZbvlhibOyUL+UV9WStYaKlZRJZxQ1ed0c fr9ZkGujbDzlrrgvKwNEpM4qGR8pZrD3j8Op/fJMOAKn7M7Lyz46pXaco31ivsNiDQxN93W9wzUKh La5yF/FA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kY3oC-0003wY-Pb; Thu, 29 Oct 2020 09:01:24 +0000 Received: from smtp25.cstnet.cn ([159.226.251.25] helo=cstnet.cn) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kY3oA-0003vD-E7 for linux-arm-kernel@lists.infradead.org; Thu, 29 Oct 2020 09:01:24 +0000 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 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-v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KxVWUJVW8JwCI42IY6I8E87Iv6xkF7I0E14v26r4j6r4UJbIYCTnIWIevJa73Uj IFyTuYvjxU4iF4DUUUU X-Originating-IP: [124.16.141.242] X-CM-SenderInfo: pyxotu46lvutnvoduhdfq/1tbiCQUEA102ZrAgaAAAs+ X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201029_050122_952971_E1066310 X-CRM114-Status: UNSURE ( 9.50 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-kernel@vger.kernel.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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);