提交 d0bc387d 编写于 作者: L Linus Torvalds

Merge git://www.linux-watchdog.org/linux-watchdog

Pull watchdog fixes from Wim Van Sebroeck:
 - a null pointer dereference fix for omap_wdt
 - some clock related fixes for pnx4008
 - an underflow fix in wdt_set_timeout() for w83977f_wdt
 - restart fix for tegra wdt
 - Kconfig change to support Freescale Layerscape platforms
 - fix for stopping the mtk_wdt watchdog

* git://www.linux-watchdog.org/linux-watchdog:
  watchdog: mtk_wdt: Use MODE_KEY when stopping the watchdog
  watchdog: Add support for Freescale Layerscape platforms
  watchdog: tegra: Stop watchdog first if restarting
  watchdog: w83977f_wdt: underflow in wdt_set_timeout()
  watchdog: pnx4008: make global wdt_clk static
  watchdog: pnx4008: fix warnings caused by enabling unprepared clock
  watchdog: omap_wdt: fix null pointer dereference
...@@ -446,7 +446,7 @@ config MAX63XX_WATCHDOG ...@@ -446,7 +446,7 @@ config MAX63XX_WATCHDOG
config IMX2_WDT config IMX2_WDT
tristate "IMX2+ Watchdog" tristate "IMX2+ Watchdog"
depends on ARCH_MXC depends on ARCH_MXC || ARCH_LAYERSCAPE
select REGMAP_MMIO select REGMAP_MMIO
select WATCHDOG_CORE select WATCHDOG_CORE
help help
......
...@@ -123,6 +123,7 @@ static int mtk_wdt_stop(struct watchdog_device *wdt_dev) ...@@ -123,6 +123,7 @@ static int mtk_wdt_stop(struct watchdog_device *wdt_dev)
reg = readl(wdt_base + WDT_MODE); reg = readl(wdt_base + WDT_MODE);
reg &= ~WDT_MODE_EN; reg &= ~WDT_MODE_EN;
reg |= WDT_MODE_KEY;
iowrite32(reg, wdt_base + WDT_MODE); iowrite32(reg, wdt_base + WDT_MODE);
return 0; return 0;
......
...@@ -205,7 +205,7 @@ static int omap_wdt_set_timeout(struct watchdog_device *wdog, ...@@ -205,7 +205,7 @@ static int omap_wdt_set_timeout(struct watchdog_device *wdog,
static unsigned int omap_wdt_get_timeleft(struct watchdog_device *wdog) static unsigned int omap_wdt_get_timeleft(struct watchdog_device *wdog)
{ {
struct omap_wdt_dev *wdev = watchdog_get_drvdata(wdog); struct omap_wdt_dev *wdev = to_omap_wdt_dev(wdog);
void __iomem *base = wdev->base; void __iomem *base = wdev->base;
u32 value; u32 value;
......
...@@ -80,7 +80,7 @@ static unsigned int heartbeat = DEFAULT_HEARTBEAT; ...@@ -80,7 +80,7 @@ static unsigned int heartbeat = DEFAULT_HEARTBEAT;
static DEFINE_SPINLOCK(io_lock); static DEFINE_SPINLOCK(io_lock);
static void __iomem *wdt_base; static void __iomem *wdt_base;
struct clk *wdt_clk; static struct clk *wdt_clk;
static int pnx4008_wdt_start(struct watchdog_device *wdd) static int pnx4008_wdt_start(struct watchdog_device *wdd)
{ {
...@@ -161,7 +161,7 @@ static int pnx4008_wdt_probe(struct platform_device *pdev) ...@@ -161,7 +161,7 @@ static int pnx4008_wdt_probe(struct platform_device *pdev)
if (IS_ERR(wdt_clk)) if (IS_ERR(wdt_clk))
return PTR_ERR(wdt_clk); return PTR_ERR(wdt_clk);
ret = clk_enable(wdt_clk); ret = clk_prepare_enable(wdt_clk);
if (ret) if (ret)
return ret; return ret;
...@@ -184,7 +184,7 @@ static int pnx4008_wdt_probe(struct platform_device *pdev) ...@@ -184,7 +184,7 @@ static int pnx4008_wdt_probe(struct platform_device *pdev)
return 0; return 0;
disable_clk: disable_clk:
clk_disable(wdt_clk); clk_disable_unprepare(wdt_clk);
return ret; return ret;
} }
...@@ -192,7 +192,7 @@ static int pnx4008_wdt_remove(struct platform_device *pdev) ...@@ -192,7 +192,7 @@ static int pnx4008_wdt_remove(struct platform_device *pdev)
{ {
watchdog_unregister_device(&pnx4008_wdd); watchdog_unregister_device(&pnx4008_wdd);
clk_disable(wdt_clk); clk_disable_unprepare(wdt_clk);
return 0; return 0;
} }
......
...@@ -140,8 +140,10 @@ static int tegra_wdt_set_timeout(struct watchdog_device *wdd, ...@@ -140,8 +140,10 @@ static int tegra_wdt_set_timeout(struct watchdog_device *wdd,
{ {
wdd->timeout = timeout; wdd->timeout = timeout;
if (watchdog_active(wdd)) if (watchdog_active(wdd)) {
tegra_wdt_stop(wdd);
return tegra_wdt_start(wdd); return tegra_wdt_start(wdd);
}
return 0; return 0;
} }
......
...@@ -224,7 +224,7 @@ static int wdt_keepalive(void) ...@@ -224,7 +224,7 @@ static int wdt_keepalive(void)
static int wdt_set_timeout(int t) static int wdt_set_timeout(int t)
{ {
int tmrval; unsigned int tmrval;
/* /*
* Convert seconds to watchdog counter time units, rounding up. * Convert seconds to watchdog counter time units, rounding up.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册