Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

watchdog: npcm: Remove unnecessary NULL check before clk_prepare_enable/clk_disable_unprepare

clk_prepare_enable() and clk_disable_unprepare() already checked
NULL clock parameter.Remove unneeded NULL check for clk here.

Signed-off-by: Chen Ni <nichen@iscas.ac.cn>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20250313084420.2481763-1-nichen@iscas.ac.cn
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>

authored by

Chen Ni and committed by
Wim Van Sebroeck
ad374670 c40524d1

+3 -6
+3 -6
drivers/watchdog/npcm_wdt.c
··· 68 68 struct npcm_wdt *wdt = to_npcm_wdt(wdd); 69 69 u32 val; 70 70 71 - if (wdt->clk) 72 - clk_prepare_enable(wdt->clk); 71 + clk_prepare_enable(wdt->clk); 73 72 74 73 if (wdd->timeout < 2) 75 74 val = 0x800; ··· 104 105 105 106 writel(0, wdt->reg); 106 107 107 - if (wdt->clk) 108 - clk_disable_unprepare(wdt->clk); 108 + clk_disable_unprepare(wdt->clk); 109 109 110 110 return 0; 111 111 } ··· 154 156 struct npcm_wdt *wdt = to_npcm_wdt(wdd); 155 157 156 158 /* For reset, we start the WDT clock and leave it running. */ 157 - if (wdt->clk) 158 - clk_prepare_enable(wdt->clk); 159 + clk_prepare_enable(wdt->clk); 159 160 160 161 writel(NPCM_WTR | NPCM_WTRE | NPCM_WTE, wdt->reg); 161 162 udelay(1000);