2
0
mirror of https://github.com/openvswitch/ovs synced 2025-09-05 08:45:23 +00:00
Files
ovs/datapath/linux-2.6/compat-2.6/include/linux/kobject.h
Ben Pfaff 806e39cfdf datapath: Add sysfs support for all (otherwise supported) Linux versions.
This turned out to be less trouble than I expected.

This builds successfully against 2.6.18 through 2.6.28.  Justin has lightly
tested it on a 2.6.27 kernel provided by Citrix.
2009-06-12 16:45:01 -07:00

24 lines
523 B
C

#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)
static inline int kobject_init_and_add(struct kobject *kobj,
struct kobj_type *ktype,
struct kobject *parent,
const char *name)
{
kobject_init(kobj);
kobject_set_name(kobj, "%s", name);
kobj->ktype = ktype;
kobj->kset = NULL;
kobj->parent = parent;
return kobject_add(kobj);
}
#endif
#endif /* linux/kobject.h wrapper */