Lines Matching refs:foo_obj
31 struct foo_obj {
37 #define to_foo_obj(x) container_of(x, struct foo_obj, kobj)
39 /* a custom attribute that works just for a struct foo_obj. */
42 ssize_t (*show)(struct foo_obj *foo, struct foo_attribute *attr, char *buf);
43 ssize_t (*store)(struct foo_obj *foo, struct foo_attribute *attr, const char *buf, size_t count);
51 * transpose back from a "default" kobject to our custom struct foo_obj and
59 struct foo_obj *foo;
79 struct foo_obj *foo;
105 struct foo_obj *foo;
114 static ssize_t foo_show(struct foo_obj *foo_obj, struct foo_attribute *attr,
117 return sprintf(buf, "%d\n", foo_obj->foo);
120 static ssize_t foo_store(struct foo_obj *foo_obj, struct foo_attribute *attr,
123 sscanf(buf, "%du", &foo_obj->foo);
134 static ssize_t b_show(struct foo_obj *foo_obj, struct foo_attribute *attr,
140 var = foo_obj->baz;
142 var = foo_obj->bar;
146 static ssize_t b_store(struct foo_obj *foo_obj, struct foo_attribute *attr,
153 foo_obj->baz = var;
155 foo_obj->bar = var;
187 static struct foo_obj *foo_obj;
188 static struct foo_obj *bar_obj;
189 static struct foo_obj *baz_obj;
191 static struct foo_obj *create_foo_obj(const char *name)
193 struct foo_obj *foo;
228 static void destroy_foo_obj(struct foo_obj *foo)
246 foo_obj = create_foo_obj("foo");
247 if (!foo_obj)
263 destroy_foo_obj(foo_obj);
272 destroy_foo_obj(foo_obj);