summaryrefslogtreecommitdiffstats
path: root/samples/kobject/kobject-example.c
diff options
context:
space:
mode:
Diffstat (limited to 'samples/kobject/kobject-example.c')
-rw-r--r--samples/kobject/kobject-example.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/samples/kobject/kobject-example.c b/samples/kobject/kobject-example.c
index 86ea0c3ad975..01562e0d4992 100644
--- a/samples/kobject/kobject-example.c
+++ b/samples/kobject/kobject-example.c
@@ -40,8 +40,9 @@ static ssize_t foo_store(struct kobject *kobj, struct kobj_attribute *attr,
40 return count; 40 return count;
41} 41}
42 42
43/* Sysfs attributes cannot be world-writable. */
43static struct kobj_attribute foo_attribute = 44static struct kobj_attribute foo_attribute =
44 __ATTR(foo, 0666, foo_show, foo_store); 45 __ATTR(foo, 0664, foo_show, foo_store);
45 46
46/* 47/*
47 * More complex function where we determine which variable is being accessed by 48 * More complex function where we determine which variable is being accessed by
@@ -73,9 +74,9 @@ static ssize_t b_store(struct kobject *kobj, struct kobj_attribute *attr,
73} 74}
74 75
75static struct kobj_attribute baz_attribute = 76static struct kobj_attribute baz_attribute =
76 __ATTR(baz, 0666, b_show, b_store); 77 __ATTR(baz, 0664, b_show, b_store);
77static struct kobj_attribute bar_attribute = 78static struct kobj_attribute bar_attribute =
78 __ATTR(bar, 0666, b_show, b_store); 79 __ATTR(bar, 0664, b_show, b_store);
79 80
80 81
81/* 82/*