diff options
Diffstat (limited to 'linux/include/media/v4l2-i2c-drv-legacy.h')
-rw-r--r-- | linux/include/media/v4l2-i2c-drv-legacy.h | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/linux/include/media/v4l2-i2c-drv-legacy.h b/linux/include/media/v4l2-i2c-drv-legacy.h index 10c3231f0..7494bdcc3 100644 --- a/linux/include/media/v4l2-i2c-drv-legacy.h +++ b/linux/include/media/v4l2-i2c-drv-legacy.h @@ -25,7 +25,7 @@ struct v4l2_i2c_driver_data { const char * const name; int driverid; int (*command)(struct i2c_client *client, unsigned int cmd, void *arg); - int (*probe)(struct i2c_client *client); + int (*probe)(struct i2c_client *client, const struct i2c_device_id *id); int (*remove)(struct i2c_client *client); int (*suspend)(struct i2c_client *client, pm_message_t state); int (*resume)(struct i2c_client *client); @@ -168,6 +168,14 @@ static struct i2c_driver v4l2_i2c_driver = { }; #endif + +#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 + static int __init v4l2_i2c_drv_init(void) { int err; @@ -198,7 +206,11 @@ static int __init v4l2_i2c_drv_init(void) v4l2_i2c_driver.driver.name = v4l2_i2c_data.name; v4l2_i2c_driver.id = v4l2_i2c_data.driverid; 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; err = i2c_add_driver(&v4l2_i2c_driver); if (err) |