]> git.karo-electronics.de Git - mv-sheeva.git/commitdiff
watchdog: sch311x_wdt.c: set parent before registeriing the misc device in probe...
authorWim Van Sebroeck <wim@iguana.be>
Thu, 10 Jun 2010 06:46:56 +0000 (06:46 +0000)
committerWim Van Sebroeck <wim@iguana.be>
Sun, 8 Aug 2010 18:21:15 +0000 (18:21 +0000)
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>
drivers/watchdog/sch311x_wdt.c

index 9c40f48804f5dbbdfb8e301a0264f98ecabc3b0d..0461858e07d004a82c4cc5ce21c036d0fc98c7e2 100644 (file)
@@ -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);