diff options
author | Sean Anderson <seanga2@gmail.com> | 2021-03-11 05:02:18 +0300 |
---|---|---|
committer | Leo Yu-Chi Liang <ycliang@andestech.com> | 2021-04-08 10:37:27 +0300 |
commit | 7d8394366a3b1a8bcbc4ea3460ff5c0901335731 (patch) | |
tree | 03232bece4cbfcabd99efb062002c5e939954aea /drivers/watchdog/designware_wdt.c | |
parent | cb57811fbc726cb93da92c05cdfbb880a8c78c50 (diff) | |
download | u-boot-7d8394366a3b1a8bcbc4ea3460ff5c0901335731.tar.xz |
wdt: dw: Switch to if(CONFIG()) instead of using #if
This is preferred over #if because the compiler can check syntax even if
the feature is disabled. This cannot be used for CONFIG_CLK because
CONFIG_DW_WDT_CLOCK_KHZ is not defined on all platforms.
Signed-off-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Diffstat (limited to 'drivers/watchdog/designware_wdt.c')
-rw-r--r-- | drivers/watchdog/designware_wdt.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/drivers/watchdog/designware_wdt.c b/drivers/watchdog/designware_wdt.c index 1f0c5a77c9..a65487d4f3 100644 --- a/drivers/watchdog/designware_wdt.c +++ b/drivers/watchdog/designware_wdt.c @@ -136,17 +136,17 @@ static int designware_wdt_probe(struct udevice *dev) priv->clk_khz = CONFIG_DW_WDT_CLOCK_KHZ; #endif -#if CONFIG_IS_ENABLED(DM_RESET) - struct reset_ctl_bulk resets; + if (CONFIG_IS_ENABLED(DM_RESET)) { + struct reset_ctl_bulk resets; - ret = reset_get_bulk(dev, &resets); - if (ret) - return ret; + ret = reset_get_bulk(dev, &resets); + if (ret) + return ret; - ret = reset_deassert_bulk(&resets); - if (ret) - return ret; -#endif + ret = reset_deassert_bulk(&resets); + if (ret) + return ret; + } /* reset to disable the watchdog */ return designware_wdt_stop(dev); |