Skip to contentSkip to conversation

backport module_i2c_driver helper macro

PATCH In review Thierry Escande 3 participants 3 messages Apr 5, 2013 – Apr 7, 2013

lore
Share & tools
lore
#0 lore raw

PATCH v3 4/8 backport module_i2c_driver helper macro

---
 backport/include/linux/compat-3.7.h |   20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
backport/include/linux/compat-3.7.h +20 -0
index 96662e3..3d35bed 100644
@@ -207,6 +207,26 @@ static inline s64 nla_get_s64(struct nlattr *nla)
 #define PLATFORM_DEVID_NONE	(-1)
 #define PLATFORM_DEVID_AUTO	(-1)
 
+/* This backports:
+ *
+ * commit 7c92784a546d2945b6d6973a30f7134be78eb7a4
+ * Author: Lars-Peter Clausen <[email protected]>
+ * Date:   Wed Nov 16 10:13:36 2011 +0100
+ *
+ *     I2C: Add helper macro for i2c_driver boilerplate
+ */
+/**
+ * module_i2c_driver() - Helper macro for registering a I2C driver
+ * @__i2c_driver: i2c_driver struct
+ *
+ * Helper macro for I2C 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_i2c_driver(__i2c_driver) \
+	module_driver(__i2c_driver, i2c_add_driver, \
+			i2c_del_driver)
+
 #else /* (LINUX_VERSION_CODE > KERNEL_VERSION(3,7,0)) */
 #define netlink_notify_portid(__notify) (__notify->portid)
 #define genl_info_snd_portid(__genl_info) (__genl_info->snd_portid)
Signature · 1 line
1.7.10.4
#1 lore raw

backport/include/linux/compat-3.7.h static inline s64 nla_get_s64(struct nlattr *nla) · line 212

Quoted 6 lines · Thierry Escande
backport/include/linux/compat-3.7.h +3 -0
 
+/* This backports:
+ *
+ * commit 7c92784a546d2945b6d6973a30f7134be78eb7a4

That commit seems to have gone into 3.3, yet you backport for anything < 3.7?

johannes

#2 lore raw
Quoted 11 lines · Johannes Berg

backport/include/linux/compat-3.7.h static inline s64 nla_get_s64(struct nlattr *nla) · line 212

Quoted 6 lines · Thierry Escande
backport/include/linux/compat-3.7.h +3 -0
 
+/* This backports:
+ *
+ * commit 7c92784a546d2945b6d6973a30f7134be78eb7a4

That commit seems to have gone into 3.3, yet you backport for anything < 3.7?

This is why I think it would help if we always had the git describe --contains output for the sha1sum and also the commit log entry on the upstream kernel.

Luis