Revert "sysfs: drop kobj_ns_type handling"

This reverts commit cb26a31157.

It mysteriously causes NetworkManager to not find the wireless device
for me.  As far as I can tell, Tejun *meant* for this commit to not make
any semantic changes, but there clearly are some.  So revert it, taking
into account some of the calling convention changes that happened in
this area in subsequent commits.

Cc: Tejun Heo <tj@kernel.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
Linus Torvalds 2013-11-07 20:47:28 +09:00
parent 0b1e73ed22
commit a1212d278c
5 changed files with 122 additions and 47 deletions

View file

@ -30,14 +30,11 @@
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;
ns = kobj->ktype->namespace(kobj);
WARN_ON(!ns); /* @kobj in a namespace is required to have !NULL tag */
return ns;
return kobj->ktype->namespace(kobj);
}
/*