]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/base/class.c
Merge branch 'for-linus' of git://git.open-osd.org/linux-open-osd
[karo-tx-linux.git] / drivers / base / class.c
index 9c6a0d6408e7b7a609bdd2170c75def1277326ca..9c63a5687d694345bc80676238ffda81d7087256 100644 (file)
@@ -63,6 +63,14 @@ static void class_release(struct kobject *kobj)
        kfree(cp);
 }
 
+static const struct kobj_ns_type_operations *class_child_ns_type(struct kobject *kobj)
+{
+       struct class_private *cp = to_class(kobj);
+       struct class *class = cp->class;
+
+       return class->ns_type;
+}
+
 static const struct sysfs_ops class_sysfs_ops = {
        .show   = class_attr_show,
        .store  = class_attr_store,
@@ -71,6 +79,7 @@ static const struct sysfs_ops class_sysfs_ops = {
 static struct kobj_type class_ktype = {
        .sysfs_ops      = &class_sysfs_ops,
        .release        = class_release,
+       .child_ns_type  = class_child_ns_type,
 };
 
 /* Hotplug events for classes go to the class class_subsys */
@@ -175,9 +184,9 @@ int __class_register(struct class *cls, struct lock_class_key *key)
        if (!cls->dev_kobj)
                cls->dev_kobj = sysfs_dev_char_kobj;
 
-#if defined(CONFIG_SYSFS_DEPRECATED) && defined(CONFIG_BLOCK)
+#if defined(CONFIG_BLOCK)
        /* let the block class directory show up in the root of sysfs */
-       if (cls != &block_class)
+       if (!sysfs_deprecated || cls != &block_class)
                cp->class_subsys.kobj.kset = class_kset;
 #else
        cp->class_subsys.kobj.kset = class_kset;
@@ -267,25 +276,6 @@ void class_destroy(struct class *cls)
        class_unregister(cls);
 }
 
-#ifdef CONFIG_SYSFS_DEPRECATED
-char *make_class_name(const char *name, struct kobject *kobj)
-{
-       char *class_name;
-       int size;
-
-       size = strlen(name) + strlen(kobject_name(kobj)) + 2;
-
-       class_name = kmalloc(size, GFP_KERNEL);
-       if (!class_name)
-               return NULL;
-
-       strcpy(class_name, name);
-       strcat(class_name, ":");
-       strcat(class_name, kobject_name(kobj));
-       return class_name;
-}
-#endif
-
 /**
  * class_dev_iter_init - initialize class device iterator
  * @iter: class iterator to initialize