X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=datapath%2Flinux-2.6%2Fcompat-2.6%2Finclude%2Flinux%2Fkobject.h;fp=datapath%2Flinux-2.6%2Fcompat-2.6%2Finclude%2Flinux%2Fkobject.h;h=4cf797e36c5711ff7ade7597490f628f3cb83b57;hb=8fef8c7121222233075a03d57db7e0b48d5f6be5;hp=c0de3d2eaf393d438aa78c8b840b5f6b339df6dc;hpb=d2cd45db48e2713b74c3a31f746f923a72294e46;p=sliver-openvswitch.git 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 index c0de3d2ea..4cf797e36 100644 --- a/datapath/linux-2.6/compat-2.6/include/linux/kobject.h +++ b/datapath/linux-2.6/compat-2.6/include/linux/kobject.h @@ -4,6 +4,7 @@ #include_next #include + #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) @@ -11,6 +12,19 @@ static inline void rpl_kobject_init(struct kobject *kobj, struct kobj_type *ktyp kobj->ktype = ktype; (kobject_init)(kobj); } + +#define kobject_add(kobj, parent, name) rpl_kobject_add(kobj, parent, name) +static inline int rpl_kobject_add(struct kobject *kobj, + struct kobject *parent, + const char *name) +{ + int err = kobject_set_name(kobj, "%s", name); + if (err) + return err; + kobj->parent = parent; + return (kobject_add)(kobj); +} #endif + #endif /* linux/kobject.h wrapper */