Merge mainline (v2.6.34-rc7)
[pandora-kernel.git] / samples / kobject / kset-example.c
index 7395c0b..d0c687f 100644 (file)
@@ -10,6 +10,7 @@
 #include <linux/kobject.h>
 #include <linux/string.h>
 #include <linux/sysfs.h>
+#include <linux/slab.h>
 #include <linux/module.h>
 #include <linux/init.h>
 
@@ -87,7 +88,7 @@ static ssize_t foo_attr_store(struct kobject *kobj,
 }
 
 /* Our custom sysfs_ops that we will associate with our ktype later on */
-static struct sysfs_ops foo_sysfs_ops = {
+static const struct sysfs_ops foo_sysfs_ops = {
        .show = foo_attr_show,
        .store = foo_attr_store,
 };
@@ -127,7 +128,7 @@ static struct foo_attribute foo_attribute =
        __ATTR(foo, 0666, foo_show, foo_store);
 
 /*
- * More complex function where we determine which varible is being accessed by
+ * More complex function where we determine which variable is being accessed by
  * looking at the attribute for the "baz" and "bar" files.
  */
 static ssize_t b_show(struct foo_obj *foo_obj, struct foo_attribute *attr,
@@ -161,7 +162,7 @@ static struct foo_attribute bar_attribute =
        __ATTR(bar, 0666, b_show, b_store);
 
 /*
- * Create a group of attributes so that we can create and destory them all
+ * Create a group of attributes so that we can create and destroy them all
  * at once.
  */
 static struct attribute *foo_default_attrs[] = {
@@ -229,7 +230,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 +265,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);