diff options
Diffstat (limited to 'samples/kobject')
-rw-r--r-- | samples/kobject/kobject-example.c | 4 | ||||
-rw-r--r-- | samples/kobject/kset-example.c | 7 |
2 files changed, 6 insertions, 5 deletions
diff --git a/samples/kobject/kobject-example.c b/samples/kobject/kobject-example.c index 8d9b55a12023..86ea0c3ad975 100644 --- a/samples/kobject/kobject-example.c +++ b/samples/kobject/kobject-example.c | |||
@@ -44,7 +44,7 @@ static struct kobj_attribute foo_attribute = | |||
44 | __ATTR(foo, 0666, foo_show, foo_store); | 44 | __ATTR(foo, 0666, foo_show, foo_store); |
45 | 45 | ||
46 | /* | 46 | /* |
47 | * More complex function where we determine which varible is being accessed by | 47 | * More complex function where we determine which variable is being accessed by |
48 | * looking at the attribute for the "baz" and "bar" files. | 48 | * looking at the attribute for the "baz" and "bar" files. |
49 | */ | 49 | */ |
50 | static ssize_t b_show(struct kobject *kobj, struct kobj_attribute *attr, | 50 | static ssize_t b_show(struct kobject *kobj, struct kobj_attribute *attr, |
@@ -79,7 +79,7 @@ static struct kobj_attribute bar_attribute = | |||
79 | 79 | ||
80 | 80 | ||
81 | /* | 81 | /* |
82 | * Create a group of attributes so that we can create and destory them all | 82 | * Create a group of attributes so that we can create and destroy them all |
83 | * at once. | 83 | * at once. |
84 | */ | 84 | */ |
85 | static struct attribute *attrs[] = { | 85 | static struct attribute *attrs[] = { |
diff --git a/samples/kobject/kset-example.c b/samples/kobject/kset-example.c index 45b7d56fb541..d0c687fd9802 100644 --- a/samples/kobject/kset-example.c +++ b/samples/kobject/kset-example.c | |||
@@ -10,6 +10,7 @@ | |||
10 | #include <linux/kobject.h> | 10 | #include <linux/kobject.h> |
11 | #include <linux/string.h> | 11 | #include <linux/string.h> |
12 | #include <linux/sysfs.h> | 12 | #include <linux/sysfs.h> |
13 | #include <linux/slab.h> | ||
13 | #include <linux/module.h> | 14 | #include <linux/module.h> |
14 | #include <linux/init.h> | 15 | #include <linux/init.h> |
15 | 16 | ||
@@ -87,7 +88,7 @@ static ssize_t foo_attr_store(struct kobject *kobj, | |||
87 | } | 88 | } |
88 | 89 | ||
89 | /* Our custom sysfs_ops that we will associate with our ktype later on */ | 90 | /* Our custom sysfs_ops that we will associate with our ktype later on */ |
90 | static struct sysfs_ops foo_sysfs_ops = { | 91 | static const struct sysfs_ops foo_sysfs_ops = { |
91 | .show = foo_attr_show, | 92 | .show = foo_attr_show, |
92 | .store = foo_attr_store, | 93 | .store = foo_attr_store, |
93 | }; | 94 | }; |
@@ -127,7 +128,7 @@ static struct foo_attribute foo_attribute = | |||
127 | __ATTR(foo, 0666, foo_show, foo_store); | 128 | __ATTR(foo, 0666, foo_show, foo_store); |
128 | 129 | ||
129 | /* | 130 | /* |
130 | * More complex function where we determine which varible is being accessed by | 131 | * More complex function where we determine which variable is being accessed by |
131 | * looking at the attribute for the "baz" and "bar" files. | 132 | * looking at the attribute for the "baz" and "bar" files. |
132 | */ | 133 | */ |
133 | static ssize_t b_show(struct foo_obj *foo_obj, struct foo_attribute *attr, | 134 | static ssize_t b_show(struct foo_obj *foo_obj, struct foo_attribute *attr, |
@@ -161,7 +162,7 @@ static struct foo_attribute bar_attribute = | |||
161 | __ATTR(bar, 0666, b_show, b_store); | 162 | __ATTR(bar, 0666, b_show, b_store); |
162 | 163 | ||
163 | /* | 164 | /* |
164 | * Create a group of attributes so that we can create and destory them all | 165 | * Create a group of attributes so that we can create and destroy them all |
165 | * at once. | 166 | * at once. |
166 | */ | 167 | */ |
167 | static struct attribute *foo_default_attrs[] = { | 168 | static struct attribute *foo_default_attrs[] = { |