]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - samples/kobject/kset-example.c
samples: mark {static|__init|__exit} for {init|exit} functions
[linux-2.6-omap-h63xx.git] / samples / kobject / kset-example.c
index b0a1b4fe6584a026866233136d69d19bb3f9d468..45b7d56fb54185d2008814ec6f4dfff4b42a2e11 100644 (file)
@@ -211,7 +211,7 @@ static struct foo_obj *create_foo_obj(const char *name)
         */
        retval = kobject_init_and_add(&foo->kobj, &foo_ktype, NULL, "%s", name);
        if (retval) {
-               kfree(foo);
+               kobject_put(&foo->kobj);
                return NULL;
        }
 
@@ -229,7 +229,7 @@ static void destroy_foo_obj(struct foo_obj *foo)
        kobject_put(&foo->kobj);
 }
 
-static int example_init(void)
+static int __init example_init(void)
 {
        /*
         * Create a kset with the name of "kset_example",
@@ -264,7 +264,7 @@ foo_error:
        return -EINVAL;
 }
 
-static void example_exit(void)
+static void __exit example_exit(void)
 {
        destroy_foo_obj(baz_obj);
        destroy_foo_obj(bar_obj);