aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/watchdog/sch311x_wdt.c
diff options
context:
space:
mode:
authorWim Van Sebroeck <wim@iguana.be>2010-06-10 06:46:56 +0000
committerWim Van Sebroeck <wim@iguana.be>2010-08-08 18:21:15 +0000
commit4c4b638e3718344e4caeb157cfbfde1b6a7b1562 (patch)
tree7f706b464a72b35aa8f4e540d6bf415bbf18958b /drivers/watchdog/sch311x_wdt.c
parentwatchdog: wdt_pci.c: move ids to pci_ids.h (diff)
downloadlinux-dev-4c4b638e3718344e4caeb157cfbfde1b6a7b1562.tar.xz
linux-dev-4c4b638e3718344e4caeb157cfbfde1b6a7b1562.zip
watchdog: sch311x_wdt.c: set parent before registeriing the misc device in probe() function
Set the paranet of the misc_device before we register the misc_device. Reported-by: Akinobu Mita <akinobu.mita@gmail.com> Signed-off-by: Wim Van sebroeck <wim@iguana.be>
Diffstat (limited to 'drivers/watchdog/sch311x_wdt.c')
-rw-r--r--drivers/watchdog/sch311x_wdt.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/watchdog/sch311x_wdt.c b/drivers/watchdog/sch311x_wdt.c
index 9c40f48804f5..0461858e07d0 100644
--- a/drivers/watchdog/sch311x_wdt.c
+++ b/drivers/watchdog/sch311x_wdt.c
@@ -425,6 +425,8 @@ static int __devinit sch311x_wdt_probe(struct platform_device *pdev)
val = therm_trip ? 0x06 : 0x04;
outb(val, sch311x_wdt_data.runtime_reg + RESGEN);
+ sch311x_wdt_miscdev.parent = dev;
+
err = misc_register(&sch311x_wdt_miscdev);
if (err != 0) {
dev_err(dev, "cannot register miscdev on minor=%d (err=%d)\n",
@@ -432,8 +434,6 @@ static int __devinit sch311x_wdt_probe(struct platform_device *pdev)
goto exit_release_region3;
}
- sch311x_wdt_miscdev.parent = dev;
-
dev_info(dev,
"SMSC SCH311x WDT initialized. timeout=%d sec (nowayout=%d)\n",
timeout, nowayout);