Skip to content

Commit

Permalink
watchdog: sch311x_wdt.c: set parent before registeriing the misc devi…
Browse files Browse the repository at this point in the history
…ce in probe() function

Set the paranet of the misc_device before we register the misc_device.

Reported-by: Akinobu Mita <[email protected]>
Signed-off-by: Wim Van sebroeck <[email protected]>
  • Loading branch information
Wim Van Sebroeck committed Aug 8, 2010
1 parent 9f2cc6f commit 4c4b638
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/watchdog/sch311x_wdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -425,15 +425,15 @@ 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",
WATCHDOG_MINOR, err);
goto exit_release_region3;
}

sch311x_wdt_miscdev.parent = dev;

dev_info(dev,
"SMSC SCH311x WDT initialized. timeout=%d sec (nowayout=%d)\n",
timeout, nowayout);
Expand Down

0 comments on commit 4c4b638

Please sign in to comment.