Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp11171543pxu; Thu, 31 Dec 2020 01:58:30 -0800 (PST) X-Google-Smtp-Source: ABdhPJyseEb4EdB7X+EjyiFq5mfWCwv/TDSKSov0qEOYeVtYCf6aESfJFoVn64zEHeJDW+XVmY3J X-Received: by 2002:a50:998f:: with SMTP id m15mr39577587edb.342.1609408709959; Thu, 31 Dec 2020 01:58:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609408709; cv=none; d=google.com; s=arc-20160816; b=PHAGsHobqijBEd6DTNDXnuk9IS4o/uSC3qs/tZrZtcU1NQ8EaRej6x2PSdLOaGSSsJ e5WpxJ7SR2wEvzg8By1JkOn8/sH7ABWz+QbBSG7fA3ITN4s9hiWZtSbu04Cna/oBJJQd NBJjy1M0Xf/uZf06rOo1Ij/iGVNMAqL46pvlX9Xisfd/YHhpbI0HH8ZiJH87ddSDv0ek 3XEyKN7L4ZYvQPy1nszEtKOPXgfys607WmUsshsJEXkFvmUWv4c8O7wJYmWTi1AVovhS wzxVcyQkL02UjDRKAD5OBFQHBJGrSjwbcfAWV6mQn4InHk2i1QSjYgSTgCs6hYP582aU MrEg== 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=wu/f7lEQqpgktSvuvskwX8MACzLdsADN0mJW+CA4pwI=; b=baSqV6e4S0dBMUHFAgm55TYsHbdHeybnmm0VzAhOlJhT79CCZNm6HAeJ0owRX+mU7M r80ZqJqrFINwtMwWTHqD3yFkcE4JsC2DLcKvYNz7G4KH/89a5De7yAXLED7ktouiazrc VeLA77dfj7D8GVZdeZJKDQnNeR4QgWrcsZbK5alWPymd6oU24cyDRz7/vl27+VAn3pPe iKxP1cnNa4ScUImd0hOhUbETO6/gXofONUFE8WGv7vK9RmWHLRVNhmwd1cn3JCBodn7s p+SF3ml1OLrqhVGid8t25ZfgrscChYd2hatJVjNIjF8p2O0y5CvkkHSqQkQ6pu5pyyjd pnmw== 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 38si25213485edq.246.2020.12.31.01.58.07; Thu, 31 Dec 2020 01:58:29 -0800 (PST) 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 S1726360AbgLaJ5Q (ORCPT + 99 others); Thu, 31 Dec 2020 04:57:16 -0500 Received: from smtp21.cstnet.cn ([159.226.251.21]:52098 "EHLO cstnet.cn" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726290AbgLaJ5Q (ORCPT ); Thu, 31 Dec 2020 04:57:16 -0500 Received: from localhost.localdomain (unknown [124.16.141.241]) by APP-01 (Coremail) with SMTP id qwCowAA3PhZDoO1fqPRgAA--.43731S2; Thu, 31 Dec 2020 17:56:19 +0800 (CST) From: Xu Wang To: robdclark@gmail.com, sean@poorly.run, airlied@linux.ie, daniel@ffwll.ch, tzimmermann@suse.de, mka@chromium.org, harigovi@codeaurora.org, emil.velikov@collabora.com, rikard.falkeborn@gmail.com, viresh.kumar@linaro.org, rnayak@codeaurora.org Cc: linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH] drm/msm: dsi: Remove redundant null check before clk_prepare_enable/clk_disable_unprepare Date: Thu, 31 Dec 2020 09:56:16 +0000 Message-Id: <20201231095616.25973-1-vulab@iscas.ac.cn> X-Mail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v26r4j6r4UJbIYCTnIWIevJa 73UjIFyTuYvjxUc6RRDUUUU X-Originating-IP: [124.16.141.241] X-CM-SenderInfo: pyxotu46lvutnvoduhdfq/1tbiCgcHA1z4jQ6uygAAsK Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Because 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 --- drivers/gpu/drm/msm/dsi/dsi_host.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/drivers/gpu/drm/msm/dsi/dsi_host.c b/drivers/gpu/drm/msm/dsi/dsi_host.c index ab281cba0f08..e7af90f045bf 100644 --- a/drivers/gpu/drm/msm/dsi/dsi_host.c +++ b/drivers/gpu/drm/msm/dsi/dsi_host.c @@ -565,13 +565,11 @@ int dsi_link_clk_enable_6g(struct msm_dsi_host *msm_host) goto pixel_clk_err; } - if (msm_host->byte_intf_clk) { - ret = clk_prepare_enable(msm_host->byte_intf_clk); - if (ret) { - pr_err("%s: Failed to enable byte intf clk\n", - __func__); - goto byte_intf_clk_err; - } + ret = clk_prepare_enable(msm_host->byte_intf_clk); + if (ret) { + pr_err("%s: Failed to enable byte intf clk\n", + __func__); + goto byte_intf_clk_err; } return 0; @@ -667,8 +665,7 @@ void dsi_link_clk_disable_6g(struct msm_dsi_host *msm_host) dev_pm_opp_set_rate(&msm_host->pdev->dev, 0); clk_disable_unprepare(msm_host->esc_clk); clk_disable_unprepare(msm_host->pixel_clk); - if (msm_host->byte_intf_clk) - clk_disable_unprepare(msm_host->byte_intf_clk); + clk_disable_unprepare(msm_host->byte_intf_clk); clk_disable_unprepare(msm_host->byte_clk); } -- 2.17.1