Commit ec9167fe authored by Chris Wilson's avatar Chris Wilson Committed by Linus Torvalds

[PATCH] perf.c misc_register patch

  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/parisc/kernel/perf.c

  This patch simply causes the function to printk() an error and return the
  error code from misc_register() if it fails. I hope this is the right
  thing to do. I moved it slightly earlier in the function so I wouldn't
  have to worry about undoing the side effects of perf_patch_images().
parent 263cd313
......@@ -500,6 +500,8 @@ static struct miscdevice perf_dev = {
*/
static int __init perf_init(void)
{
int retval;
/* Determine correct processor interface to use */
bitmask_array = perf_bitmasks;
......@@ -518,11 +520,17 @@ static int __init perf_init(void)
return -ENODEV;
}
retval = misc_register(&perf_dev);
if (retval < 0) {
printk(KERN_ERR "Performance monitoring counters: "
"cannot register misc device.\n");
return retval;
}
/* Patch the images to match the system */
perf_patch_images();
spin_lock_init(&perf_lock);
misc_register(&perf_dev);
/* TODO: this only lets us access the first cpu.. what to do for SMP? */
cpu_device = cpu_data[0].dev;
......
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