datapath: Fix OOPS when dp_sysfs_add_if() fails.
[sliver-openvswitch.git] / datapath / linux-2.6 / compat-2.6 / include / linux / kobject.h
diff --git a/datapath/linux-2.6/compat-2.6/include/linux/kobject.h b/datapath/linux-2.6/compat-2.6/include/linux/kobject.h
new file mode 100644 (file)
index 0000000..c0de3d2
--- /dev/null
@@ -0,0 +1,16 @@
+#ifndef __LINUX_KOBJECT_WRAPPER_H
+#define __LINUX_KOBJECT_WRAPPER_H 1
+
+#include_next <linux/kobject.h>
+
+#include <linux/version.h>
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,25)
+#define kobject_init(kobj, ktype) rpl_kobject_init(kobj, ktype)
+static inline void rpl_kobject_init(struct kobject *kobj, struct kobj_type *ktype)
+{
+       kobj->ktype = ktype;
+       (kobject_init)(kobj);
+}
+#endif
+
+#endif /* linux/kobject.h wrapper */