X-Git-Url: https://git.karo-electronics.de/?a=blobdiff_plain;f=drivers%2Foprofile%2Foprof.c;h=b336cd9ee7a114c54d6b7b85d48cacc6f3ed1a6d;hb=c936335e7ac24d1751543e2007a89e3eb649cc2a;hp=dc8a0428260dd3d5c141982d0da9dcdaceca70f7;hpb=c1176d6f03e1085797ce83648a2c76ae15a2b515;p=karo-tx-linux.git diff --git a/drivers/oprofile/oprof.c b/drivers/oprofile/oprof.c index dc8a0428260d..b336cd9ee7a1 100644 --- a/drivers/oprofile/oprof.c +++ b/drivers/oprofile/oprof.c @@ -253,22 +253,26 @@ static int __init oprofile_init(void) int err; err = oprofile_arch_init(&oprofile_ops); - if (err < 0 || timer) { printk(KERN_INFO "oprofile: using timer interrupt.\n"); - oprofile_timer_init(&oprofile_ops); + err = oprofile_timer_init(&oprofile_ops); + if (err) + goto out_arch; } - err = oprofilefs_register(); if (err) - oprofile_arch_exit(); + goto out_arch; + return 0; +out_arch: + oprofile_arch_exit(); return err; } static void __exit oprofile_exit(void) { + oprofile_timer_exit(); oprofilefs_unregister(); oprofile_arch_exit(); }