msm: msm_watchdog: Don't pet the watchdog if it isn't enabled
If the kernel commandline has msm_watchdog.enable set to
zero and another driver calls pet_watchdog, the kernel will
panic since msm_tmr0_base is NULL (early return in probe).
Fix the pet_watchdog function to be a no-op if enable is
set to zero.
Change-Id: I4e1b72f9d98d5b4ca9ea312abde39dac7cb94b7d
Signed-off-by: Vikram Mulukutla <markivx@codeaurora.org>
diff --git a/arch/arm/mach-msm/msm_watchdog.c b/arch/arm/mach-msm/msm_watchdog.c
index aabb644..9b8bc61 100644
--- a/arch/arm/mach-msm/msm_watchdog.c
+++ b/arch/arm/mach-msm/msm_watchdog.c
@@ -217,6 +217,9 @@
unsigned long long slack_ns;
unsigned long long bark_time_ns = bark_time * 1000000ULL;
+ if (!enable)
+ return;
+
slack = __raw_readl(msm_tmr0_base + WDT0_STS) >> 3;
slack = ((bark_time*WDT_HZ)/1000) - slack;
if (slack < min_slack_ticks)