Skip to content

Commit

Permalink
watchdog: ep93xx_wdt.c: fix platform probe
Browse files Browse the repository at this point in the history
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 <wim@iguana.be>
  • Loading branch information
Wim Van Sebroeck committed Mar 27, 2012
1 parent 3e0113a commit 697b41e
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions drivers/watchdog/ep93xx_wdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 697b41e

Please sign in to comment.