]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/base/class.c
Merge remote-tracking branch 'driver-core/driver-core-next'
[karo-tx-linux.git] / drivers / base / class.c
index 8b7818b800569b287536cb366080af3e92f393f2..f96f70419a785a722283336a4ca71a73015574b9 100644 (file)
@@ -47,18 +47,6 @@ static ssize_t class_attr_store(struct kobject *kobj, struct attribute *attr,
        return ret;
 }
 
-static const void *class_attr_namespace(struct kobject *kobj,
-                                       const struct attribute *attr)
-{
-       struct class_attribute *class_attr = to_class_attr(attr);
-       struct subsys_private *cp = to_subsys_private(kobj);
-       const void *ns = NULL;
-
-       if (class_attr->namespace)
-               ns = class_attr->namespace(cp->class, class_attr);
-       return ns;
-}
-
 static void class_release(struct kobject *kobj)
 {
        struct subsys_private *cp = to_subsys_private(kobj);
@@ -86,7 +74,6 @@ static const struct kobj_ns_type_operations *class_child_ns_type(struct kobject
 static const struct sysfs_ops class_sysfs_ops = {
        .show      = class_attr_show,
        .store     = class_attr_store,
-       .namespace = class_attr_namespace,
 };
 
 static struct kobj_type class_ktype = {
@@ -99,21 +86,23 @@ static struct kobj_type class_ktype = {
 static struct kset *class_kset;
 
 
-int class_create_file(struct class *cls, const struct class_attribute *attr)
+int class_create_file_ns(struct class *cls, const struct class_attribute *attr,
+                        const void *ns)
 {
        int error;
        if (cls)
-               error = sysfs_create_file(&cls->p->subsys.kobj,
-                                         &attr->attr);
+               error = sysfs_create_file_ns(&cls->p->subsys.kobj,
+                                            &attr->attr, ns);
        else
                error = -EINVAL;
        return error;
 }
 
-void class_remove_file(struct class *cls, const struct class_attribute *attr)
+void class_remove_file_ns(struct class *cls, const struct class_attribute *attr,
+                         const void *ns)
 {
        if (cls)
-               sysfs_remove_file(&cls->p->subsys.kobj, &attr->attr);
+               sysfs_remove_file_ns(&cls->p->subsys.kobj, &attr->attr, ns);
 }
 
 static struct class *class_get(struct class *cls)
@@ -600,8 +589,8 @@ int __init classes_init(void)
        return 0;
 }
 
-EXPORT_SYMBOL_GPL(class_create_file);
-EXPORT_SYMBOL_GPL(class_remove_file);
+EXPORT_SYMBOL_GPL(class_create_file_ns);
+EXPORT_SYMBOL_GPL(class_remove_file_ns);
 EXPORT_SYMBOL_GPL(class_unregister);
 EXPORT_SYMBOL_GPL(class_destroy);