static inline void class_destroy(struct class *cs)
{};
-static inline struct class_device *class_device_create(struct class *cs,
- dev_t dev, struct device *device, const char *fmt, ...)
+static inline struct class_device *CLASS_DEVICE_CREATE(struct class *cls,
+ struct class_device *parent, dev_t devt, struct device *device,
+ char *fmt, ...)
{
return NULL;
};
-
+
static inline void class_device_destroy(struct class *cs, dev_t dev)
{};
#else
+
#include_next <linux/device.h>
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,13)
+
#define class_create(owner, name) \
(struct class *)class_simple_create(owner, name)
#define class_destroy(cs) \
class_simple_destroy((struct class_simple *)(cs))
-#define class_device_create(cs, dev, device, fmt...) \
+#define CLASS_DEVICE_CREATE(cs, parent, dev, device, fmt...) \
class_simple_device_add((struct class_simple *)(cs), \
dev, device, fmt)
#define class_device_destroy(cs, dev) \
class_simple_device_remove(dev)
-#endif
-#endif
+#else
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,15)
+
+#define CLASS_DEVICE_CREATE(cs, parent, dev, device, fmt...) \
+ class_device_create(cs, dev, device, fmt)
+
+#else
+
+#define CLASS_DEVICE_CREATE(cs, parent, dev, device, fmt...) \
+ class_device_create(cs, parent, dev, device, fmt)
+
+#endif // LINUX_VERSION_CODE < KERNEL_VERSION(2,6,15)
+
+#endif // LINUX_VERSION_CODE < KERNEL_VERSION(2,6,13)
+
+#endif // LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
#endif // __COMPAT_LINUX_DEVICE_H_