This patch eliminates a lot of warnings like this on old kernels:

media_build/v4l/au8522_decoder.c:842: warning: data definition has no type or 
storage class
media_build/v4l/au8522_decoder.c:842: warning: type defaults to 'int' in 
declaration of 'module_i2c_driver'
media_build/v4l/au8522_decoder.c:842: warning: parameter names (without types) 
in function declaration
media_build/v4l/au8522_decoder.c:832: warning: 'au8522_driver' defined but not 
used

Tested with 2.6.32 and 3.3-rc6 without problems.

Signed-off-by: Gianluca Gennari <gennar...@gmail.com>
---
 v4l/compat.h |   20 ++++++++++++++++++++
 1 files changed, 20 insertions(+), 0 deletions(-)

diff --git a/v4l/compat.h b/v4l/compat.h
index 62710c9..acc105c 100644
--- a/v4l/compat.h
+++ b/v4l/compat.h
@@ -898,4 +898,24 @@ module_exit(plat_mod_exit);
 #define DMA_MEM_TO_DEV DMA_TO_DEVICE
 #endif
 
+#ifndef module_driver
+#define module_driver(__driver, __register, __unregister) \
+static int __init __driver##_init(void) \
+{ \
+       return __register(&(__driver)); \
+} \
+module_init(__driver##_init); \
+static void __exit __driver##_exit(void) \
+{ \
+       __unregister(&(__driver)); \
+} \
+module_exit(__driver##_exit);
+#endif
+
+#ifndef module_i2c_driver
+#define module_i2c_driver(__i2c_driver) \
+       module_driver(__i2c_driver, i2c_add_driver, \
+                       i2c_del_driver)
+#endif
+
 #endif /*  _COMPAT_H */
-- 
1.7.0.4

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to