Loading lib/kobject.c +64 −75 Original line number Diff line number Diff line Loading @@ -18,18 +18,15 @@ #include <linux/stat.h> #include <linux/slab.h> /** /* * populate_dir - populate directory with attributes. * @kobj: object we're working on. * * Most subsystems have a set of default attributes that * are associated with an object that registers with them. * This is a helper called during object registration that * loops through the default attributes of the subsystem * and creates attributes files for them in sysfs. * * Most subsystems have a set of default attributes that are associated * with an object that registers with them. This is a helper called during * object registration that loops through the default attributes of the * subsystem and creates attributes files for them in sysfs. */ static int populate_dir(struct kobject *kobj) { struct kobj_type *t = get_ktype(kobj); Loading @@ -39,7 +36,8 @@ static int populate_dir(struct kobject * kobj) if (t && t->default_attrs) { for (i = 0; (attr = t->default_attrs[i]) != NULL; i++) { if ((error = sysfs_create_file(kobj,attr))) error = sysfs_create_file(kobj, attr); if (error) break; } } Loading @@ -52,7 +50,8 @@ static int create_dir(struct kobject * kobj) if (kobject_name(kobj)) { error = sysfs_create_dir(kobj); if (!error) { if ((error = populate_dir(kobj))) error = populate_dir(kobj); if (error) sysfs_remove_dir(kobj); } } Loading Loading @@ -403,7 +402,6 @@ EXPORT_SYMBOL_GPL(kobject_init_and_add); * @kobj: object in question. * @new_name: object's new name */ int kobject_rename(struct kobject *kobj, const char *new_name) { int error = 0; Loading Loading @@ -465,7 +463,6 @@ out: * @kobj: object in question. * @new_parent: object's new parent (can be NULL) */ int kobject_move(struct kobject *kobj, struct kobject *new_parent) { int error; Loading Loading @@ -516,7 +513,6 @@ out: * kobject_del - unlink kobject from hierarchy. * @kobj: object. */ void kobject_del(struct kobject *kobj) { if (!kobj) Loading @@ -533,7 +529,6 @@ void kobject_del(struct kobject * kobj) * kobject_get - increment refcount for object. * @kobj: object. */ struct kobject *kobject_get(struct kobject *kobj) { if (kobj) Loading Loading @@ -673,7 +668,6 @@ EXPORT_SYMBOL_GPL(kobject_create_and_add); * kset_init - initialize a kset for use * @k: kset */ void kset_init(struct kset *k) { kobject_init_internal(&k->kobj); Loading Loading @@ -715,7 +709,6 @@ struct sysfs_ops kobj_sysfs_ops = { * kset_register - initialize and add a kset. * @k: kset. */ int kset_register(struct kset *k) { int err; Loading @@ -731,12 +724,10 @@ int kset_register(struct kset * k) return 0; } /** * kset_unregister - remove a kset. * @k: kset. */ void kset_unregister(struct kset *k) { if (!k) Loading @@ -744,7 +735,6 @@ void kset_unregister(struct kset * k) kobject_put(&k->kobj); } /** * kset_find_obj - search for object in kset. * @kset: kset we're looking in. Loading @@ -754,7 +744,6 @@ void kset_unregister(struct kset * k) * looking for a matching kobject. If matching object is found * take a reference and return the object. */ struct kobject *kset_find_obj(struct kset *kset, const char *name) { struct list_head *entry; Loading lib/kobject_uevent.c +3 −4 Original line number Diff line number Diff line Loading @@ -238,7 +238,8 @@ int kobject_uevent_env(struct kobject *kobj, enum kobject_action action, retval = add_uevent_var(env, "HOME=/"); if (retval) goto exit; retval = add_uevent_var(env, "PATH=/sbin:/bin:/usr/sbin:/usr/bin"); retval = add_uevent_var(env, "PATH=/sbin:/bin:/usr/sbin:/usr/bin"); if (retval) goto exit; Loading @@ -250,7 +251,6 @@ exit: kfree(env); return retval; } EXPORT_SYMBOL_GPL(kobject_uevent_env); /** Loading @@ -266,7 +266,6 @@ int kobject_uevent(struct kobject *kobj, enum kobject_action action) { return kobject_uevent_env(kobj, action, NULL); } EXPORT_SYMBOL_GPL(kobject_uevent); /** Loading Loading
lib/kobject.c +64 −75 Original line number Diff line number Diff line Loading @@ -18,18 +18,15 @@ #include <linux/stat.h> #include <linux/slab.h> /** /* * populate_dir - populate directory with attributes. * @kobj: object we're working on. * * Most subsystems have a set of default attributes that * are associated with an object that registers with them. * This is a helper called during object registration that * loops through the default attributes of the subsystem * and creates attributes files for them in sysfs. * * Most subsystems have a set of default attributes that are associated * with an object that registers with them. This is a helper called during * object registration that loops through the default attributes of the * subsystem and creates attributes files for them in sysfs. */ static int populate_dir(struct kobject *kobj) { struct kobj_type *t = get_ktype(kobj); Loading @@ -39,7 +36,8 @@ static int populate_dir(struct kobject * kobj) if (t && t->default_attrs) { for (i = 0; (attr = t->default_attrs[i]) != NULL; i++) { if ((error = sysfs_create_file(kobj,attr))) error = sysfs_create_file(kobj, attr); if (error) break; } } Loading @@ -52,7 +50,8 @@ static int create_dir(struct kobject * kobj) if (kobject_name(kobj)) { error = sysfs_create_dir(kobj); if (!error) { if ((error = populate_dir(kobj))) error = populate_dir(kobj); if (error) sysfs_remove_dir(kobj); } } Loading Loading @@ -403,7 +402,6 @@ EXPORT_SYMBOL_GPL(kobject_init_and_add); * @kobj: object in question. * @new_name: object's new name */ int kobject_rename(struct kobject *kobj, const char *new_name) { int error = 0; Loading Loading @@ -465,7 +463,6 @@ out: * @kobj: object in question. * @new_parent: object's new parent (can be NULL) */ int kobject_move(struct kobject *kobj, struct kobject *new_parent) { int error; Loading Loading @@ -516,7 +513,6 @@ out: * kobject_del - unlink kobject from hierarchy. * @kobj: object. */ void kobject_del(struct kobject *kobj) { if (!kobj) Loading @@ -533,7 +529,6 @@ void kobject_del(struct kobject * kobj) * kobject_get - increment refcount for object. * @kobj: object. */ struct kobject *kobject_get(struct kobject *kobj) { if (kobj) Loading Loading @@ -673,7 +668,6 @@ EXPORT_SYMBOL_GPL(kobject_create_and_add); * kset_init - initialize a kset for use * @k: kset */ void kset_init(struct kset *k) { kobject_init_internal(&k->kobj); Loading Loading @@ -715,7 +709,6 @@ struct sysfs_ops kobj_sysfs_ops = { * kset_register - initialize and add a kset. * @k: kset. */ int kset_register(struct kset *k) { int err; Loading @@ -731,12 +724,10 @@ int kset_register(struct kset * k) return 0; } /** * kset_unregister - remove a kset. * @k: kset. */ void kset_unregister(struct kset *k) { if (!k) Loading @@ -744,7 +735,6 @@ void kset_unregister(struct kset * k) kobject_put(&k->kobj); } /** * kset_find_obj - search for object in kset. * @kset: kset we're looking in. Loading @@ -754,7 +744,6 @@ void kset_unregister(struct kset * k) * looking for a matching kobject. If matching object is found * take a reference and return the object. */ struct kobject *kset_find_obj(struct kset *kset, const char *name) { struct list_head *entry; Loading
lib/kobject_uevent.c +3 −4 Original line number Diff line number Diff line Loading @@ -238,7 +238,8 @@ int kobject_uevent_env(struct kobject *kobj, enum kobject_action action, retval = add_uevent_var(env, "HOME=/"); if (retval) goto exit; retval = add_uevent_var(env, "PATH=/sbin:/bin:/usr/sbin:/usr/bin"); retval = add_uevent_var(env, "PATH=/sbin:/bin:/usr/sbin:/usr/bin"); if (retval) goto exit; Loading @@ -250,7 +251,6 @@ exit: kfree(env); return retval; } EXPORT_SYMBOL_GPL(kobject_uevent_env); /** Loading @@ -266,7 +266,6 @@ int kobject_uevent(struct kobject *kobj, enum kobject_action action) { return kobject_uevent_env(kobj, action, NULL); } EXPORT_SYMBOL_GPL(kobject_uevent); /** Loading