Commit 46ac060e authored by Chris Wilson's avatar Chris Wilson Committed by Linus Torvalds

[PATCH] drivers_macintosh_via-pmu_.c

  As part of my work on the Linux Kernel Janitors project, cleaning up on
  functions which call misc_register and don't check for an error
  return, I would like to submit my patch to drivers/macintosh/via-pmu*.c.

  There is one call in each file which calls misc_register without checking
  the return value. The attached patch should fix that.
parent f72704eb
......@@ -2702,8 +2702,10 @@ static struct miscdevice pmu_device = {
void pmu_device_init(void)
{
if (via)
misc_register(&pmu_device);
if (!via)
return;
if (misc_register(&pmu_device) < 0)
printk(KERN_ERR "via-pmu: cannot register misc device.\n");
}
#endif /* CONFIG_PMAC_PBOOK */
......
......@@ -1052,8 +1052,10 @@ static struct miscdevice pmu_device = {
void pmu_device_init(void)
{
if (via)
misc_register(&pmu_device);
if (!via)
return;
if (misc_register(&pmu_device) < 0)
printk(KERN_ERR "via-pmu68k: cannot register misc device.\n");
}
#endif /* CONFIG_PMAC_PBOOK */
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