return NOTIFY_OK;               /* Let default notifier send signals */
 }
 
-static struct notifier_block cnmips_cu2_notifier = {
-       .notifier_call = cnmips_cu2_call,
-};
-
 static int cnmips_cu2_setup(void)
 {
-       return register_cu2_notifier(&cnmips_cu2_notifier);
+       return cu2_notifier(cnmips_cu2_call, 0);
 }
 early_initcall(cnmips_cu2_setup);
 
 #ifndef __ASM_COP2_H
 #define __ASM_COP2_H
 
+#include <linux/notifier.h>
+
 enum cu2_ops {
        CU2_EXCEPTION,
        CU2_LWC2_OP,
 extern int register_cu2_notifier(struct notifier_block *nb);
 extern int cu2_notifier_call_chain(unsigned long val, void *v);
 
+#define cu2_notifier(fn, pri)                                          \
+({                                                                     \
+       static struct notifier_block fn##_nb __cpuinitdata = {          \
+               .notifier_call = fn,                                    \
+               .priority = pri                                         \
+       };                                                              \
+                                                                       \
+       register_cu2_notifier(&fn##_nb);                                \
+})
+
 #endif /* __ASM_COP2_H */
 
        return NOTIFY_OK;
 }
 
-static struct notifier_block default_cu2_notifier = {
-       .notifier_call  = default_cu2_call,
-       .priority       = 0x80000000,           /* Run last  */
-};
-
 asmlinkage void do_cpu(struct pt_regs *regs)
 {
        unsigned int __user *epc;
 
        sort_extable(__start___dbe_table, __stop___dbe_table);
 
-       register_cu2_notifier(&default_cu2_notifier);
+       cu2_notifier(default_cu2_call, 0x80000000);     /* Run last  */
 }