aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/oprofile/timer_int.c
diff options
context:
space:
mode:
authorRobert Richter <robert.richter@amd.com>2011-10-14 15:46:10 +0200
committerRobert Richter <robert.richter@amd.com>2011-11-04 15:04:35 +0100
commit75c43a20b220f885c39ffa7cdbbb1191e257a9a9 (patch)
treea623847b0235f618438b03785b4860a80e0d4b1b /drivers/oprofile/timer_int.c
parentoprofile, x86: Add kernel parameter oprofile.cpu_type=timer (diff)
downloadlinux-dev-75c43a20b220f885c39ffa7cdbbb1191e257a9a9.tar.xz
linux-dev-75c43a20b220f885c39ffa7cdbbb1191e257a9a9.zip
oprofile: Remove exit function for timer mode
Remove exit functions by moving init/exit code to oprofile's setup/ shutdown functions. Doing so the oprofile module exit code will be easier and less error-prone. Signed-off-by: Robert Richter <robert.richter@amd.com>
Diffstat (limited to 'drivers/oprofile/timer_int.c')
-rw-r--r--drivers/oprofile/timer_int.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/drivers/oprofile/timer_int.c b/drivers/oprofile/timer_int.c
index 878fba126582..93404f72dfa8 100644
--- a/drivers/oprofile/timer_int.c
+++ b/drivers/oprofile/timer_int.c
@@ -97,24 +97,24 @@ static struct notifier_block __refdata oprofile_cpu_notifier = {
.notifier_call = oprofile_cpu_notify,
};
-int oprofile_timer_init(struct oprofile_operations *ops)
+static int oprofile_hrtimer_setup(void)
{
- int rc;
-
- rc = register_hotcpu_notifier(&oprofile_cpu_notifier);
- if (rc)
- return rc;
- ops->create_files = NULL;
- ops->setup = NULL;
- ops->shutdown = NULL;
- ops->start = oprofile_hrtimer_start;
- ops->stop = oprofile_hrtimer_stop;
- ops->cpu_type = "timer";
- printk(KERN_INFO "oprofile: using timer interrupt.\n");
- return 0;
+ return register_hotcpu_notifier(&oprofile_cpu_notifier);
}
-void oprofile_timer_exit(void)
+static void oprofile_hrtimer_shutdown(void)
{
unregister_hotcpu_notifier(&oprofile_cpu_notifier);
}
+
+int oprofile_timer_init(struct oprofile_operations *ops)
+{
+ ops->create_files = NULL;
+ ops->setup = oprofile_hrtimer_setup;
+ ops->shutdown = oprofile_hrtimer_shutdown;
+ ops->start = oprofile_hrtimer_start;
+ ops->stop = oprofile_hrtimer_stop;
+ ops->cpu_type = "timer";
+ printk(KERN_INFO "oprofile: using timer interrupt.\n");
+ return 0;
+}