Lines Matching refs:foo
20 * Then tree kobjects are created and assigned to this kset, "foo", "baz",
33 int foo;
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);
59 struct foo_obj *foo;
62 foo = to_foo_obj(kobj);
67 return attribute->show(foo, attribute, buf);
79 struct foo_obj *foo;
82 foo = to_foo_obj(kobj);
87 return attribute->store(foo, attribute, buf, len);
105 struct foo_obj *foo;
107 foo = to_foo_obj(kobj);
108 kfree(foo);
112 * The "foo" file where the .foo variable is read from and written to.
117 return sprintf(buf, "%d\n", foo_obj->foo);
123 sscanf(buf, "%du", &foo_obj->foo);
128 __ATTR(foo, 0666, foo_show, foo_store);
193 struct foo_obj *foo;
197 foo = kzalloc(sizeof(*foo), GFP_KERNEL);
198 if (!foo)
205 foo->kobj.kset = example_kset;
213 retval = kobject_init_and_add(&foo->kobj, &foo_ktype, NULL, "%s", name);
215 kobject_put(&foo->kobj);
223 kobject_uevent(&foo->kobj, KOBJ_ADD);
225 return foo;
228 static void destroy_foo_obj(struct foo_obj *foo)
230 kobject_put(&foo->kobj);
246 foo_obj = create_foo_obj("foo");