Linux-OMAP Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] ARM: OMAP2+: Remove redundant null check before clk_prepare_enable/clk_disable_unprepare
@ 2020-11-04  6:45 Xu Wang
  2020-11-19  9:53 ` Tony Lindgren
  0 siblings, 1 reply; 2+ messages in thread
From: Xu Wang @ 2020-11-04  6:45 UTC (permalink / raw)
  To: tony, linux, linux-omap, linux-arm-kernel; +Cc: linux-kernel

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 <vulab@iscas.ac.cn>
---
 arch/arm/mach-omap2/display.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/arch/arm/mach-omap2/display.c b/arch/arm/mach-omap2/display.c
index 2000fca6bd4e..6daaa645ae5d 100644
--- a/arch/arm/mach-omap2/display.c
+++ b/arch/arm/mach-omap2/display.c
@@ -385,8 +385,7 @@ int omap_dss_reset(struct omap_hwmod *oh)
 	}
 
 	for (i = oh->opt_clks_cnt, oc = oh->opt_clks; i > 0; i--, oc++)
-		if (oc->_clk)
-			clk_prepare_enable(oc->_clk);
+		clk_prepare_enable(oc->_clk);
 
 	dispc_disable_outputs();
 
@@ -412,8 +411,7 @@ int omap_dss_reset(struct omap_hwmod *oh)
 		pr_debug("dss_core: softreset done\n");
 
 	for (i = oh->opt_clks_cnt, oc = oh->opt_clks; i > 0; i--, oc++)
-		if (oc->_clk)
-			clk_disable_unprepare(oc->_clk);
+		clk_disable_unprepare(oc->_clk);
 
 	r = (c == MAX_MODULE_SOFTRESET_WAIT) ? -ETIMEDOUT : 0;
 
-- 
2.17.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] ARM: OMAP2+: Remove redundant null check before clk_prepare_enable/clk_disable_unprepare
  2020-11-04  6:45 [PATCH] ARM: OMAP2+: Remove redundant null check before clk_prepare_enable/clk_disable_unprepare Xu Wang
@ 2020-11-19  9:53 ` Tony Lindgren
  0 siblings, 0 replies; 2+ messages in thread
From: Tony Lindgren @ 2020-11-19  9:53 UTC (permalink / raw)
  To: Xu Wang; +Cc: linux, linux-omap, linux-arm-kernel, linux-kernel

* Xu Wang <vulab@iscas.ac.cn> [201104 08:45]:
> Because clk_prepare_enable() and clk_disable_unprepare() already checked
> NULL clock parameter, so the additional checks are unnecessary, just
> remove them.

Thanks applying into omap-for-v5.11/soc.

Tony

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-04  6:45 [PATCH] ARM: OMAP2+: Remove redundant null check before clk_prepare_enable/clk_disable_unprepare Xu Wang
2020-11-19  9:53 ` Tony Lindgren

Linux-OMAP Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-omap/0 linux-omap/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-omap linux-omap/ https://lore.kernel.org/linux-omap \
		linux-omap@vger.kernel.org
	public-inbox-index linux-omap

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-omap


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git