aboutsummaryrefslogtreecommitdiffstats
path: root/samples/kobject/kset-example.c
diff options
context:
space:
mode:
Diffstat (limited to 'samples/kobject/kset-example.c')
-rw-r--r--samples/kobject/kset-example.c7
1 files changed, 4 insertions, 3 deletions
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 */
90static struct sysfs_ops foo_sysfs_ops = { 91static 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 */
133static ssize_t b_show(struct foo_obj *foo_obj, struct foo_attribute *attr, 134static 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 */
167static struct attribute *foo_default_attrs[] = { 168static struct attribute *foo_default_attrs[] = {