summaryrefslogtreecommitdiffstats
path: root/lib/kobject.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@suse.de>2007-04-13 13:15:19 -0700
committerGreg Kroah-Hartman <gregkh@suse.de>2007-05-02 18:57:59 -0700
commit823bccfc4002296ba88c3ad0f049e1abd8108d30 (patch)
tree5338ae0b32409446af4cd00c5107d9405d5bf0b6 /lib/kobject.c
parent2609e7b9bebfd433254c02538ba803dc516ff674 (diff)
downloadop-kernel-dev-823bccfc4002296ba88c3ad0f049e1abd8108d30.zip
op-kernel-dev-823bccfc4002296ba88c3ad0f049e1abd8108d30.tar.gz
remove "struct subsystem" as it is no longer needed
We need to work on cleaning up the relationship between kobjects, ksets and ktypes. The removal of 'struct subsystem' is the first step of this, especially as it is not really needed at all. Thanks to Kay for fixing the bugs in this patch. Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'lib/kobject.c')
-rw-r--r--lib/kobject.c69
1 files changed, 8 insertions, 61 deletions
diff --git a/lib/kobject.c b/lib/kobject.c
index cecf2fb..fc5f3f6 100644
--- a/lib/kobject.c
+++ b/lib/kobject.c
@@ -582,22 +582,10 @@ void kset_init(struct kset * k)
/**
* kset_add - add a kset object to the hierarchy.
* @k: kset.
- *
- * Simply, this adds the kset's embedded kobject to the
- * hierarchy.
- * We also try to make sure that the kset's embedded kobject
- * has a parent before it is added. We only care if the embedded
- * kobject is not part of a kset itself, since kobject_add()
- * assigns a parent in that case.
- * If that is the case, and the kset has a controlling subsystem,
- * then we set the kset's parent to be said subsystem.
*/
int kset_add(struct kset * k)
{
- if (!k->kobj.parent && !k->kobj.kset && k->subsys)
- k->kobj.parent = &k->subsys->kset.kobj;
-
return kobject_add(&k->kobj);
}
@@ -656,53 +644,28 @@ struct kobject * kset_find_obj(struct kset * kset, const char * name)
return ret;
}
-
-void subsystem_init(struct subsystem * s)
+void subsystem_init(struct kset *s)
{
- kset_init(&s->kset);
+ kset_init(s);
}
-/**
- * subsystem_register - register a subsystem.
- * @s: the subsystem we're registering.
- *
- * Once we register the subsystem, we want to make sure that
- * the kset points back to this subsystem.
- */
-
-int subsystem_register(struct subsystem * s)
+int subsystem_register(struct kset *s)
{
- int error;
-
- if (!s)
- return -EINVAL;
-
- subsystem_init(s);
- pr_debug("subsystem %s: registering\n",s->kset.kobj.name);
-
- if (!(error = kset_add(&s->kset))) {
- if (!s->kset.subsys)
- s->kset.subsys = s;
- }
- return error;
+ return kset_register(s);
}
-void subsystem_unregister(struct subsystem * s)
+void subsystem_unregister(struct kset *s)
{
- if (!s)
- return;
- pr_debug("subsystem %s: unregistering\n",s->kset.kobj.name);
- kset_unregister(&s->kset);
+ kset_unregister(s);
}
-
/**
* subsystem_create_file - export sysfs attribute file.
* @s: subsystem.
* @a: subsystem attribute descriptor.
*/
-int subsys_create_file(struct subsystem * s, struct subsys_attribute * a)
+int subsys_create_file(struct kset *s, struct subsys_attribute *a)
{
int error = 0;
@@ -710,28 +673,12 @@ int subsys_create_file(struct subsystem * s, struct subsys_attribute * a)
return -EINVAL;
if (subsys_get(s)) {
- error = sysfs_create_file(&s->kset.kobj,&a->attr);
+ error = sysfs_create_file(&s->kobj, &a->attr);
subsys_put(s);
}
return error;
}
-
-/**
- * subsystem_remove_file - remove sysfs attribute file.
- * @s: subsystem.
- * @a: attribute desciptor.
- */
-#if 0
-void subsys_remove_file(struct subsystem * s, struct subsys_attribute * a)
-{
- if (subsys_get(s)) {
- sysfs_remove_file(&s->kset.kobj,&a->attr);
- subsys_put(s);
- }
-}
-#endif /* 0 */
-
EXPORT_SYMBOL(kobject_init);
EXPORT_SYMBOL(kobject_register);
EXPORT_SYMBOL(kobject_unregister);
OpenPOWER on IntegriCloud