diff options
Diffstat (limited to 'linux/include')
-rw-r--r-- | linux/include/media/v4l2-common.h | 2 | ||||
-rw-r--r-- | linux/include/media/v4l2-i2c-drv.h | 21 |
2 files changed, 5 insertions, 18 deletions
diff --git a/linux/include/media/v4l2-common.h b/linux/include/media/v4l2-common.h index ca06eb8d5..8c534d476 100644 --- a/linux/include/media/v4l2-common.h +++ b/linux/include/media/v4l2-common.h @@ -135,7 +135,7 @@ struct v4l2_device; struct v4l2_subdev; struct v4l2_subdev_ops; -#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 22) +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 26) int v4l2_i2c_attach(struct i2c_adapter *adapter, int address, struct i2c_driver *driver, const char *name, int (*probe)(struct i2c_client *, const struct i2c_device_id *)); diff --git a/linux/include/media/v4l2-i2c-drv.h b/linux/include/media/v4l2-i2c-drv.h index 38a26fc73..52898df94 100644 --- a/linux/include/media/v4l2-i2c-drv.h +++ b/linux/include/media/v4l2-i2c-drv.h @@ -44,11 +44,10 @@ struct v4l2_i2c_driver_data { int (*remove)(struct i2c_client *client); int (*suspend)(struct i2c_client *client, pm_message_t state); int (*resume)(struct i2c_client *client); -#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 22) +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 26) int (*legacy_probe)(struct i2c_adapter *adapter); int legacy_class; -#endif -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 26) +#else const struct i2c_device_id *id_table; #endif }; @@ -56,31 +55,19 @@ struct v4l2_i2c_driver_data { static struct v4l2_i2c_driver_data v4l2_i2c_data; static struct i2c_driver v4l2_i2c_driver; -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 22) -#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 26) -static int compat_legacy_probe(struct i2c_client *client) -{ - return v4l2_i2c_data.probe(client, NULL); -} -#endif +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 26) -/* Bus-based I2C implementation for kernels >= 2.6.22 */ +/* Bus-based I2C implementation for kernels >= 2.6.26 */ static int __init v4l2_i2c_drv_init(void) { v4l2_i2c_driver.driver.name = v4l2_i2c_data.name; v4l2_i2c_driver.command = v4l2_i2c_data.command; -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 26) v4l2_i2c_driver.probe = v4l2_i2c_data.probe; -#else - v4l2_i2c_driver.probe = compat_legacy_probe; -#endif v4l2_i2c_driver.remove = v4l2_i2c_data.remove; v4l2_i2c_driver.suspend = v4l2_i2c_data.suspend; v4l2_i2c_driver.resume = v4l2_i2c_data.resume; -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 26) v4l2_i2c_driver.id_table = v4l2_i2c_data.id_table; -#endif return i2c_add_driver(&v4l2_i2c_driver); } |