Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Linus Torvalds committed Nov 27, 2015
2 parents 80e0c50 + 5da2bf1 commit d0bc387
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 8 deletions.
2 changes: 1 addition & 1 deletion drivers/watchdog/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@ config MAX63XX_WATCHDOG

config IMX2_WDT
tristate "IMX2+ Watchdog"
depends on ARCH_MXC
depends on ARCH_MXC || ARCH_LAYERSCAPE
select REGMAP_MMIO
select WATCHDOG_CORE
help
Expand Down
1 change: 1 addition & 0 deletions drivers/watchdog/mtk_wdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ static int mtk_wdt_stop(struct watchdog_device *wdt_dev)

reg = readl(wdt_base + WDT_MODE);
reg &= ~WDT_MODE_EN;
reg |= WDT_MODE_KEY;
iowrite32(reg, wdt_base + WDT_MODE);

return 0;
Expand Down
2 changes: 1 addition & 1 deletion drivers/watchdog/omap_wdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
struct omap_wdt_dev *wdev = watchdog_get_drvdata(wdog);
struct omap_wdt_dev *wdev = to_omap_wdt_dev(wdog);
void __iomem *base = wdev->base;
u32 value;

Expand Down
8 changes: 4 additions & 4 deletions drivers/watchdog/pnx4008_wdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ static unsigned int heartbeat = DEFAULT_HEARTBEAT;

static DEFINE_SPINLOCK(io_lock);
static void __iomem *wdt_base;
struct clk *wdt_clk;
static struct clk *wdt_clk;

static int pnx4008_wdt_start(struct watchdog_device *wdd)
{
Expand Down Expand Up @@ -161,7 +161,7 @@ static int pnx4008_wdt_probe(struct platform_device *pdev)
if (IS_ERR(wdt_clk))
return PTR_ERR(wdt_clk);

ret = clk_enable(wdt_clk);
ret = clk_prepare_enable(wdt_clk);
if (ret)
return ret;

Expand All @@ -184,15 +184,15 @@ static int pnx4008_wdt_probe(struct platform_device *pdev)
return 0;

disable_clk:
clk_disable(wdt_clk);
clk_disable_unprepare(wdt_clk);
return ret;
}

static int pnx4008_wdt_remove(struct platform_device *pdev)
{
watchdog_unregister_device(&pnx4008_wdd);

clk_disable(wdt_clk);
clk_disable_unprepare(wdt_clk);

return 0;
}
Expand Down
4 changes: 3 additions & 1 deletion drivers/watchdog/tegra_wdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,10 @@ static int tegra_wdt_set_timeout(struct watchdog_device *wdd,
{
wdd->timeout = timeout;

if (watchdog_active(wdd))
if (watchdog_active(wdd)) {
tegra_wdt_stop(wdd);
return tegra_wdt_start(wdd);
}

return 0;
}
Expand Down
2 changes: 1 addition & 1 deletion drivers/watchdog/w83977f_wdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ static int wdt_keepalive(void)

static int wdt_set_timeout(int t)
{
int tmrval;
unsigned int tmrval;

/*
* Convert seconds to watchdog counter time units, rounding up.
Expand Down

0 comments on commit d0bc387

Please sign in to comment.