Lines Matching defs:foo
18 * Then tree kobjects are created and assigned to this kset, "foo", "baz",
31 int foo;
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);
57 struct foo_obj *foo;
60 foo = to_foo_obj(kobj);
65 return attribute->show(foo, attribute, buf);
77 struct foo_obj *foo;
80 foo = to_foo_obj(kobj);
85 return attribute->store(foo, attribute, buf, len);
103 struct foo_obj *foo;
105 foo = to_foo_obj(kobj);
106 kfree(foo);
110 * The "foo" file where the .foo variable is read from and written to.
115 return sysfs_emit(buf, "%d\n", foo_obj->foo);
123 ret = kstrtoint(buf, 10, &foo_obj->foo);
132 __ATTR(foo, 0664, foo_show, foo_store);
201 struct foo_obj *foo;
205 foo = kzalloc(sizeof(*foo), GFP_KERNEL);
206 if (!foo)
213 foo->kobj.kset = example_kset;
221 retval = kobject_init_and_add(&foo->kobj, &foo_ktype, NULL, "%s", name);
223 kobject_put(&foo->kobj);
231 kobject_uevent(&foo->kobj, KOBJ_ADD);
233 return foo;
236 static void destroy_foo_obj(struct foo_obj *foo)
238 kobject_put(&foo->kobj);
254 foo_obj = create_foo_obj("foo");