Commit f7d1fc56 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

kobject: clean up kobject_get() convoluted logic.

parent 6d739c04
...@@ -425,14 +425,11 @@ void kobject_unregister(struct kobject * kobj) ...@@ -425,14 +425,11 @@ void kobject_unregister(struct kobject * kobj)
struct kobject * kobject_get(struct kobject * kobj) struct kobject * kobject_get(struct kobject * kobj)
{ {
struct kobject * ret = kobj;
if (kobj) { if (kobj) {
WARN_ON(!atomic_read(&kobj->refcount)); WARN_ON(!atomic_read(&kobj->refcount));
atomic_inc(&kobj->refcount); atomic_inc(&kobj->refcount);
} else }
ret = NULL; return kobj;
return ret;
} }
/** /**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment