From 697b41e4d4b20b8d8564f5501927b0ed07153990 Mon Sep 17 00:00:00 2001 From: Wim Van Sebroeck Date: Tue, 13 Mar 2012 09:06:12 +0100 Subject: [PATCH] watchdog: ep93xx_wdt.c: fix platform probe Fix the device/driver init so that the misc_register happens as last (since this opens userspace access to the device). Signed-off-by: Wim Van Sebroeck --- drivers/watchdog/ep93xx_wdt.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/watchdog/ep93xx_wdt.c b/drivers/watchdog/ep93xx_wdt.c index 35c49da..bd01bde 100644 --- a/drivers/watchdog/ep93xx_wdt.c +++ b/drivers/watchdog/ep93xx_wdt.c @@ -224,21 +224,21 @@ static int __devinit ep93xx_wdt_probe(struct platform_device *pdev) if (!mmio_base) return -ENXIO; - err = misc_register(&ep93xx_wdt_miscdev); - - val = readl(mmio_base + EP93XX_WATCHDOG); - boot_status = val & 0x01 ? 1 : 0; - - pr_info("EP93XX watchdog, driver version " WDT_VERSION "%s\n", - (val & 0x08) ? " (nCS1 disable detected)" : ""); - if (timeout < 1 || timeout > 3600) { timeout = WDT_TIMEOUT; pr_info("timeout value must be 1<=x<=3600, using %d\n", timeout); } + val = readl(mmio_base + EP93XX_WATCHDOG); + boot_status = val & 0x01 ? 1 : 0; + setup_timer(&timer, ep93xx_timer_ping, 1); + + err = misc_register(&ep93xx_wdt_miscdev); + + pr_info("EP93XX watchdog, driver version " WDT_VERSION "%s\n", + (val & 0x08) ? " (nCS1 disable detected)" : ""); return err; } -- 2.7.4