livepatch: Simplify API by removing registration step
[linux-2.6-microblaze.git] / samples / livepatch / livepatch-shadow-fix1.c
index e8f1bd6..a5a5cac 100644 (file)
@@ -157,25 +157,13 @@ static struct klp_patch patch = {
 
 static int livepatch_shadow_fix1_init(void)
 {
-       int ret;
-
-       ret = klp_register_patch(&patch);
-       if (ret)
-               return ret;
-       ret = klp_enable_patch(&patch);
-       if (ret) {
-               WARN_ON(klp_unregister_patch(&patch));
-               return ret;
-       }
-       return 0;
+       return klp_enable_patch(&patch);
 }
 
 static void livepatch_shadow_fix1_exit(void)
 {
        /* Cleanup any existing SV_LEAK shadow variables */
        klp_shadow_free_all(SV_LEAK, livepatch_fix1_dummy_leak_dtor);
-
-       WARN_ON(klp_unregister_patch(&patch));
 }
 
 module_init(livepatch_shadow_fix1_init);