From: Johannes Berg <[email protected]>

Signed-off-by: Johannes Berg <[email protected]>
---
 backport/backport-include/linux/compat-3.3.h | 14 --------------
 backport/backport-include/linux/usb.h        | 21 +++++++++++++++++++++
 2 files changed, 21 insertions(+), 14 deletions(-)
 create mode 100644 backport/backport-include/linux/usb.h

diff --git a/backport/backport-include/linux/compat-3.3.h 
b/backport/backport-include/linux/compat-3.3.h
index eded1bb..5950e2b 100644
--- a/backport/backport-include/linux/compat-3.3.h
+++ b/backport/backport-include/linux/compat-3.3.h
@@ -307,20 +307,6 @@ static inline void qdisc_cb_private_validate(const struct 
sk_buff *skb, int sz)
 
 #define NL80211_FEATURE_SK_TX_STATUS 0
 
-/* source include/linux/usb.h */
-/**
- * module_usb_driver() - Helper macro for registering a USB driver
- * @__usb_driver: usb_driver struct
- *
- * Helper macro for USB drivers which do not do anything special in module
- * init/exit. This eliminates a lot of boilerplate. Each module may only
- * use this macro once, and calling it replaces module_init() and module_exit()
- */
-#define module_usb_driver(__usb_driver) \
-       module_driver(__usb_driver, usb_register, \
-                      usb_deregister)
-
-
 /*
  * PCI_EXP_TYPE_RC_EC was added via 1b6b8ce2 on v2.6.30-rc4~20 :
  *
diff --git a/backport/backport-include/linux/usb.h 
b/backport/backport-include/linux/usb.h
new file mode 100644
index 0000000..2c81e48
--- /dev/null
+++ b/backport/backport-include/linux/usb.h
@@ -0,0 +1,21 @@
+#ifndef __BACKPORT_USB_H
+#define __BACKPORT_USB_H
+
+#include_next <linux/usb.h>
+#include <linux/version.h>
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0)
+/**
+ * module_usb_driver() - Helper macro for registering a USB driver
+ * @__usb_driver: usb_driver struct
+ *
+ * Helper macro for USB drivers which do not do anything special in module
+ * init/exit. This eliminates a lot of boilerplate. Each module may only
+ * use this macro once, and calling it replaces module_init() and module_exit()
+ */
+#define module_usb_driver(__usb_driver) \
+       module_driver(__usb_driver, usb_register, \
+                      usb_deregister)
+#endif
+
+#endif /* __BACKPORT_USB_H */
-- 
1.8.0

--
To unsubscribe from this list: send the line "unsubscribe backports" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to