Lines Matching refs:foo_obj
29 struct foo_obj {
35 #define to_foo_obj(x) container_of(x, struct foo_obj, kobj)
37 /* a custom attribute that works just for a struct foo_obj. */
40 ssize_t (*show)(struct foo_obj *foo, struct foo_attribute *attr, char *buf);
41 ssize_t (*store)(struct foo_obj *foo, struct foo_attribute *attr, const char *buf, size_t count);
49 * transpose back from a "default" kobject to our custom struct foo_obj and
57 struct foo_obj *foo;
77 struct foo_obj *foo;
103 struct foo_obj *foo;
112 static ssize_t foo_show(struct foo_obj *foo_obj, struct foo_attribute *attr,
115 return sysfs_emit(buf, "%d\n", foo_obj->foo);
118 static ssize_t foo_store(struct foo_obj *foo_obj, struct foo_attribute *attr,
123 ret = kstrtoint(buf, 10, &foo_obj->foo);
138 static ssize_t b_show(struct foo_obj *foo_obj, struct foo_attribute *attr,
144 var = foo_obj->baz;
146 var = foo_obj->bar;
150 static ssize_t b_store(struct foo_obj *foo_obj, struct foo_attribute *attr,
160 foo_obj->baz = var;
162 foo_obj->bar = var;
195 static struct foo_obj *foo_obj;
196 static struct foo_obj *bar_obj;
197 static struct foo_obj *baz_obj;
199 static struct foo_obj *create_foo_obj(const char *name)
201 struct foo_obj *foo;
236 static void destroy_foo_obj(struct foo_obj *foo)
254 foo_obj = create_foo_obj("foo");
255 if (!foo_obj)
271 destroy_foo_obj(foo_obj);
281 destroy_foo_obj(foo_obj);