summaryrefslogtreecommitdiff
path: root/arch/arm/mach-imx/system.c
diff options
context:
space:
mode:
authorAlexander Shiyan <shc_work@mail.ru>2014-06-13 11:26:12 +0400
committerShawn Guo <shawn.guo@freescale.com>2014-07-18 16:10:13 +0800
commitce8ad883873abaccca7282e9136694f49d72ab03 (patch)
treebbe6c06188c7e3deeb5057b37ff1a5937c26a190 /arch/arm/mach-imx/system.c
parenta74f30582d428066912230eb809a9d6cbb16ee2e (diff)
ARM: i.MX system: Simplify handling watchdog clock
This patch simplifies handling watchdog clock a bit. As an additional change, now we properly check WDT clock in a reset function. Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
Diffstat (limited to 'arch/arm/mach-imx/system.c')
-rw-r--r--arch/arm/mach-imx/system.c20
1 files changed, 7 insertions, 13 deletions
diff --git a/arch/arm/mach-imx/system.c b/arch/arm/mach-imx/system.c
index 3b0733edb68c..92d11c271222 100644
--- a/arch/arm/mach-imx/system.c
+++ b/arch/arm/mach-imx/system.c
@@ -42,7 +42,7 @@ void mxc_restart(enum reboot_mode mode, const char *cmd)
{
unsigned int wcr_enable;
- if (wdog_clk)
+ if (!IS_ERR(wdog_clk))
clk_enable(wdog_clk);
if (cpu_is_mx1())
@@ -79,13 +79,10 @@ void __init mxc_arch_reset_init(void __iomem *base)
wdog_base = base;
wdog_clk = clk_get_sys("imx2-wdt.0", NULL);
- if (IS_ERR(wdog_clk)) {
+ if (IS_ERR(wdog_clk))
pr_warn("%s: failed to get wdog clock\n", __func__);
- wdog_clk = NULL;
- return;
- }
-
- clk_prepare(wdog_clk);
+ else
+ clk_prepare(wdog_clk);
}
void __init mxc_arch_reset_init_dt(void)
@@ -97,13 +94,10 @@ void __init mxc_arch_reset_init_dt(void)
WARN_ON(!wdog_base);
wdog_clk = of_clk_get(np, 0);
- if (IS_ERR(wdog_clk)) {
+ if (IS_ERR(wdog_clk))
pr_warn("%s: failed to get wdog clock\n", __func__);
- wdog_clk = NULL;
- return;
- }
-
- clk_prepare(wdog_clk);
+ else
+ clk_prepare(wdog_clk);
}
#ifdef CONFIG_CACHE_L2X0