datapath: Remove reciprocal_div compat code.
[sliver-openvswitch.git] / datapath / linux / compat / 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
8 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,25)
9 #define kobject_init(kobj, ktype) rpl_kobject_init(kobj, ktype)
10 static inline void rpl_kobject_init(struct kobject *kobj, struct kobj_type *ktype)
11 {
12         kobj->ktype = ktype;
13         (kobject_init)(kobj);
14 }
15
16 #define kobject_add(kobj, parent, name) rpl_kobject_add(kobj, parent, name)
17 static inline int rpl_kobject_add(struct kobject *kobj,
18                                   struct kobject *parent,
19                                   const char *name)
20 {
21         int err = kobject_set_name(kobj, "%s", name);
22         if (err)
23                 return err;
24         kobj->parent = parent;
25         return (kobject_add)(kobj);
26 }
27 #endif
28
29
30 #endif /* linux/kobject.h wrapper */