Skip to contentSkip to conversation

compat: add device_create() implementation for Linux 2.6.26 and older

PATCH Applied Pavel Roskin 2 participants 3 messages Apr 6, 2010 Tracing

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 compat: add device_create() implementation for Linux 2.6.26 and older

This should make 25-device_create.patch in compat-wireless unnecessary.

---
 include/linux/compat-2.6.27.h |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
include/linux/compat-2.6.27.h +8 -0
index e27115b..d667222 100644
@@ -228,6 +228,14 @@ static inline void debugfs_remove_recursive(struct dentry *dentry)
 { }
 #endif
 
+#define device_create(cls, parent, devt, drvdata, fmt, ...)		\
+({									\
+	struct device *_dev;						\
+	_dev = (device_create)(cls, parent, devt, fmt, __VA_ARGS__);	\
+	dev_set_drvdata(_dev, drvdata);					\
+	_dev;								\
+})
+
 #endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27)) */
 
 #endif /* LINUX_26_27_COMPAT_H */
#1 lore raw

PATCH 2/2 compat: add stub headers linux/tracepoint.h and trace/define_trace.h

This should make 13-trace.patch in compat-wireless unnecessary.

---
 include/linux/tracepoint.h   |    8 ++++++++
 include/trace/define_trace.h |    8 ++++++++
 2 files changed, 16 insertions(+), 0 deletions(-)
 create mode 100644 include/linux/tracepoint.h
 create mode 100644 include/trace/define_trace.h
include/linux/tracepoint.h new file +8 -0
new file mode 100644
index 0000000..7484716
@@ -0,0 +1,8 @@
+#ifndef _COMPAT_LINUX_TRACEPOINT_H
+#define _COMPAT_LINUX_TRACEPOINT_H 1
+
+#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,27))
+#include_next <linux/tracepoint.h>
+#endif /* (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,27)) */
+
+#endif	/* _COMPAT_LINUX_TRACEPOINT_H */
include/trace/define_trace.h new file +8 -0
new file mode 100644
index 0000000..f5c01de
@@ -0,0 +1,8 @@
+#ifndef _COMPAT_TRACE_DEFINE_TRACE_H
+#define _COMPAT_TRACE_DEFINE_TRACE_H 1
+
+#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,30))
+#include_next <trace/define_trace.h>
+#endif /* (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,30)) */
+
+#endif	/* _COMPAT_TRACE_DEFINE_TRACE_H */
#2 lore raw

Re: [PATCH 2/2] compat: add stub headers linux/tracepoint.h and trace/define_trace.h

Quoted 1 line · Pavel Roskin

This should make 13-trace.patch in compat-wireless unnecessary.

Thanks! Applied both.

Luis