]> git.proxmox.com Git - ovs.git/blob - datapath/linux-2.6/compat-2.6/include/linux/kobject.h
datapath: Add sysfs support for all (otherwise supported) Linux versions.
[ovs.git] / datapath / linux-2.6 / compat-2.6 / include / linux / kobject.h
1 #ifndef __LINUX_KOBJECT_WRAPPER_H
2 #define __LINUX_KOBJECT_WRAPPER_H 1
3
4 #include_next <linux/kobject.h>
5
6 #include <linux/version.h>
7 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,25)
8 static inline int kobject_init_and_add(struct kobject *kobj,
9 struct kobj_type *ktype,
10 struct kobject *parent,
11 const char *name)
12 {
13 kobject_init(kobj);
14 kobject_set_name(kobj, "%s", name);
15 kobj->ktype = ktype;
16 kobj->kset = NULL;
17 kobj->parent = parent;
18
19 return kobject_add(kobj);
20 }
21 #endif
22
23 #endif /* linux/kobject.h wrapper */