mlx4_core: Increase command timeout for INIT_HCA to 10 seconds
[pandora-kernel.git] / lib / kobject.c
index 10ae2eb..03d4036 100644 (file)
@@ -2,6 +2,8 @@
  * kobject.c - library routines for handling generic kernel objects
  *
  * Copyright (c) 2002-2003 Patrick Mochel <mochel@osdl.org>
+ * Copyright (c) 2006-2007 Greg Kroah-Hartman <greg@kroah.com>
+ * Copyright (c) 2006-2007 Novell Inc.
  *
  * This file is released under the GPLv2.
  *
@@ -44,11 +46,11 @@ static int populate_dir(struct kobject * kobj)
        return error;
 }
 
-static int create_dir(struct kobject *kobj, struct sysfs_dirent *shadow_parent)
+static int create_dir(struct kobject * kobj)
 {
        int error = 0;
        if (kobject_name(kobj)) {
-               error = sysfs_create_dir(kobj, shadow_parent);
+               error = sysfs_create_dir(kobj);
                if (!error) {
                        if ((error = populate_dir(kobj)))
                                sysfs_remove_dir(kobj);
@@ -131,7 +133,6 @@ void kobject_init(struct kobject * kobj)
                return;
        kref_init(&kobj->kref);
        INIT_LIST_HEAD(&kobj->entry);
-       init_waitqueue_head(&kobj->poll);
        kobj->kset = kset_get(kobj->kset);
 }
 
@@ -157,12 +158,11 @@ static void unlink(struct kobject * kobj)
 }
 
 /**
- *     kobject_shadow_add - add an object to the hierarchy.
+ *     kobject_add - add an object to the hierarchy.
  *     @kobj:  object.
- *     @shadow_parent: sysfs directory to add to.
  */
 
-int kobject_shadow_add(struct kobject *kobj, struct sysfs_dirent *shadow_parent)
+int kobject_add(struct kobject * kobj)
 {
        int error = 0;
        struct kobject * parent;
@@ -194,7 +194,7 @@ int kobject_shadow_add(struct kobject *kobj, struct sysfs_dirent *shadow_parent)
                kobj->parent = parent;
        }
 
-       error = create_dir(kobj, shadow_parent);
+       error = create_dir(kobj);
        if (error) {
                /* unlink does the kobject_put() for us */
                unlink(kobj);
@@ -215,16 +215,6 @@ int kobject_shadow_add(struct kobject *kobj, struct sysfs_dirent *shadow_parent)
        return error;
 }
 
-/**
- *     kobject_add - add an object to the hierarchy.
- *     @kobj:  object.
- */
-int kobject_add(struct kobject * kobj)
-{
-       return kobject_shadow_add(kobj, NULL);
-}
-
-
 /**
  *     kobject_register - initialize and add an object.
  *     @kobj:  object in question.
@@ -334,7 +324,7 @@ int kobject_rename(struct kobject * kobj, const char *new_name)
        /* Note : if we want to send the new name alone, not the full path,
         * we could probably use kobject_name(kobj); */
 
-       error = sysfs_rename_dir(kobj, kobj->parent->sd, new_name);
+       error = sysfs_rename_dir(kobj, new_name);
 
        /* This function is mostly/only used for network interface.
         * Some hotplug package track interfaces by their name and
@@ -350,27 +340,6 @@ out:
        return error;
 }
 
-/**
- *     kobject_rename - change the name of an object
- *     @kobj:  object in question.
- *     @new_parent: object's new parent
- *     @new_name: object's new name
- */
-
-int kobject_shadow_rename(struct kobject *kobj,
-                         struct sysfs_dirent *new_parent, const char *new_name)
-{
-       int error = 0;
-
-       kobj = kobject_get(kobj);
-       if (!kobj)
-               return -EINVAL;
-       error = sysfs_rename_dir(kobj, new_parent, new_name);
-       kobject_put(kobj);
-
-       return error;
-}
-
 /**
  *     kobject_move - move object to another parent
  *     @kobj:  object in question.
@@ -650,11 +619,6 @@ struct kobject * kset_find_obj(struct kset * kset, const char * name)
        return ret;
 }
 
-void subsystem_init(struct kset *s)
-{
-       kset_init(s);
-}
-
 int subsystem_register(struct kset *s)
 {
        return kset_register(s);