Commit c153abec authored by Dave Jones's avatar Dave Jones Committed by Linus Torvalds

[PATCH] region handling cleanup

Done by William Stinson.
Adds error handling to request_region() calls,
and converts some old check_region() calls too.
parent e71be658
......@@ -221,8 +221,18 @@ static int __init acq_init(void)
spin_lock_init(&acq_lock);
if (misc_register(&acq_miscdev))
return -ENODEV;
request_region(WDT_STOP, 1, "Acquire WDT");
request_region(WDT_START, 1, "Acquire WDT");
if (!request_region(WDT_STOP, 1, "Acquire WDT"))
{
misc_deregister(&acq_miscdev);
return -EIO;
}
if (!request_region(WDT_START, 1, "Acquire WDT"))
{
release_region(WDT_STOP, 1);
misc_deregister(&acq_miscdev);
return -EIO;
}
register_reboot_notifier(&acq_notifier);
return 0;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment