summaryrefslogtreecommitdiff
path: root/v4l/compat.h
diff options
context:
space:
mode:
Diffstat (limited to 'v4l/compat.h')
-rw-r--r--v4l/compat.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/v4l/compat.h b/v4l/compat.h
index b4c1ca374..581262bdf 100644
--- a/v4l/compat.h
+++ b/v4l/compat.h
@@ -499,6 +499,13 @@ do { \
# define BIT_WORD(nr) ((nr) / BITS_PER_LONG)
#endif
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24)
+#define i2c_verify_client(dev) \
+ ((dev->bus == &i2c_bus_type) ? to_i2c_client(dev) : NULL)
+#elif LINUX_VERSION_CODE < KERNEL_VERSION(2,6,25)
+#define i2c_verify_client(dev) \
+ ((dev->bus && 0 == strcmp(dev->bus->name, "i2c")) ? to_i2c_client(dev) : NULL)
+#endif
#ifndef USB_DEVICE_AND_INTERFACE_INFO
# define USB_DEVICE_AND_INTERFACE_INFO(vend,prod,cl,sc,pr) \