]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - lib/kobject.c
sysfs: drop kobj_ns_type handling
[karo-tx-linux.git] / lib / kobject.c
index 85fb3a161b2137e4d2a8dd558a14f22656a8225b..e769ee3c2fb91ce4391b4bf7e9c99c8caa551909 100644 (file)
 const void *kobject_namespace(struct kobject *kobj)
 {
        const struct kobj_ns_type_operations *ns_ops = kobj_ns_ops(kobj);
+       const void *ns;
 
        if (!ns_ops || ns_ops->type == KOBJ_NS_TYPE_NONE)
                return NULL;
 
-       return kobj->ktype->namespace(kobj);
+       ns = kobj->ktype->namespace(kobj);
+       WARN_ON(!ns);   /* @kobj in a namespace is required to have !NULL tag */
+       return ns;
 }
 
 /*