From: Guenter Roeck Date: Sat, 17 Aug 2013 20:58:41 +0000 (-0700) Subject: watchdog: w83627hf: Enable watchdog device only if not already enabled X-Git-Tag: v4.14-rc1~8547^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ac461103c57ac46cd6778f1fd0352ff0e4a2d38e;p=platform%2Fkernel%2Flinux-rpi.git watchdog: w83627hf: Enable watchdog device only if not already enabled There is no need to enable the watchdog device if it is already enabled. Also, when enabling the watchdog device, only set the watchdog device enable bit and do not touch other bits; depending on the chip type, those bits may enable other functionality. Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck --- diff --git a/drivers/watchdog/w83627hf_wdt.c b/drivers/watchdog/w83627hf_wdt.c index 910d43736821..c5d34f46e7ad 100644 --- a/drivers/watchdog/w83627hf_wdt.c +++ b/drivers/watchdog/w83627hf_wdt.c @@ -107,7 +107,9 @@ static void w83627hf_init(struct watchdog_device *wdog) } outb_p(0x30, WDT_EFER); /* select CR30 */ - outb_p(0x01, WDT_EFDR); /* set bit 0 to activate GPIO2 */ + t = inb(WDT_EFDR); + if (!(t & 0x01)) + outb_p(t | 0x01, WDT_EFDR); /* set bit 0 to activate GPIO2 */ outb_p(0xF6, WDT_EFER); /* Select CRF6 */ t = inb_p(WDT_EFDR); /* read CRF6 */