summary refs log tree commit diff
path: root/drivers/base/class.c
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2011-10-28 14:16:43 +0900
committerPaul Mundt <lethal@linux-sh.org>2011-10-28 14:16:43 +0900
commitd4d9781d1dd04ff134e3d43383dfa9991f7c54c6 (patch)
tree28e799ec49f72bf37f39d192d21f25bffb682aab /drivers/base/class.c
parentf5a18f932e051ff0f19dcd80a421a4dd9b11f10f (diff)
parent396e6e49c58bb23d1814d3c240c736c9f01523c5 (diff)
downloadlinux-d4d9781d1dd04ff134e3d43383dfa9991f7c54c6.tar.gz
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux into sh-latest
Diffstat (limited to 'drivers/base/class.c')
-rw-r--r--drivers/base/class.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/drivers/base/class.c b/drivers/base/class.c
index 4f1df2e8fd74..b80d91cc8c3a 100644
--- a/drivers/base/class.c
+++ b/drivers/base/class.c
@@ -47,6 +47,18 @@ 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);
@@ -72,8 +84,9 @@ 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,
+	.show	   = class_attr_show,
+	.store	   = class_attr_store,
+	.namespace = class_attr_namespace,
 };
 
 static struct kobj_type class_ktype = {