diff options
Diffstat (limited to 'linux/include/media/v4l2-i2c-drv-legacy.h')
-rw-r--r-- | linux/include/media/v4l2-i2c-drv-legacy.h | 28 |
1 files changed, 1 insertions, 27 deletions
diff --git a/linux/include/media/v4l2-i2c-drv-legacy.h b/linux/include/media/v4l2-i2c-drv-legacy.h index e95e2a072..738f87454 100644 --- a/linux/include/media/v4l2-i2c-drv-legacy.h +++ b/linux/include/media/v4l2-i2c-drv-legacy.h @@ -30,11 +30,7 @@ struct v4l2_i2c_driver_data { int (*suspend)(struct i2c_client *client, pm_message_t state); int (*resume)(struct i2c_client *client); int (*legacy_probe)(struct i2c_adapter *adapter); -#ifdef I2C_CLASS_TV_ANALOG int legacy_class; -#else - int legacy_id; -#endif #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 26) const struct i2c_device_id *id_table; #endif @@ -49,12 +45,7 @@ static struct i2c_client_address_data addr_data; static struct i2c_driver v4l2_i2c_driver_legacy; static char v4l2_i2c_drv_name_legacy[32]; -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) static int v4l2_i2c_drv_attach_legacy(struct i2c_adapter *adapter, int address, int kind) -#else -static int v4l2_i2c_drv_attach_legacy(struct i2c_adapter *adapter, int address, - unsigned short flags, int kind) -#endif { return v4l2_i2c_attach(adapter, address, &v4l2_i2c_driver_legacy, v4l2_i2c_drv_name_legacy, v4l2_i2c_data.probe); @@ -67,11 +58,7 @@ static int v4l2_i2c_drv_probe_legacy(struct i2c_adapter *adapter) return i2c_probe(adapter, &addr_data, v4l2_i2c_drv_attach_legacy); return 0; } -#ifdef I2C_CLASS_TV_ANALOG if (adapter->class & v4l2_i2c_data.legacy_class) -#else - if (adapter->id == v4l2_i2c_data.legacy_id) -#endif return i2c_probe(adapter, &addr_data, v4l2_i2c_drv_attach_legacy); return 0; } @@ -87,14 +74,9 @@ static int v4l2_i2c_drv_detach_legacy(struct i2c_client *client) if (err) return err; kfree(client); - -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) - MOD_DEC_USE_COUNT; -#endif return 0; } -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) #if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,14) #if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,20) static int v4l2_i2c_drv_suspend_helper(struct i2c_client *client, pm_message_t state) @@ -130,19 +112,17 @@ static int v4l2_i2c_drv_resume_helper(struct device * dev, u32 level) #endif return v4l2_i2c_data.resume ? v4l2_i2c_data.resume(client) : 0; } -#endif /* ----------------------------------------------------------------------- */ /* i2c implementation */ static struct i2c_driver v4l2_i2c_driver_legacy = { -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)) && (LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,15)) +#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,15) .owner = THIS_MODULE, #endif #if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,15) .flags = I2C_DF_NOTIFY, #endif -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) .driver = { #if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,15) .owner = THIS_MODULE, @@ -152,7 +132,6 @@ static struct i2c_driver v4l2_i2c_driver_legacy = { .resume = v4l2_i2c_drv_resume_helper, #endif }, -#endif .attach_adapter = v4l2_i2c_drv_probe_legacy, .detach_client = v4l2_i2c_drv_detach_legacy, #if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,20) @@ -184,13 +163,8 @@ static int __init v4l2_i2c_drv_init(void) strlcpy(v4l2_i2c_drv_name_legacy, v4l2_i2c_data.name, sizeof(v4l2_i2c_drv_name_legacy)); strlcat(v4l2_i2c_drv_name_legacy, "'", sizeof(v4l2_i2c_drv_name_legacy)); -#ifdef I2C_CLASS_TV_ANALOG if (v4l2_i2c_data.legacy_class == 0) v4l2_i2c_data.legacy_class = I2C_CLASS_TV_ANALOG; -#else - if (v4l2_i2c_data.legacy_id == 0) - v4l2_i2c_data.legacy_id = I2C_HW_B_BT848; -#endif #if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,15) strlcpy(v4l2_i2c_driver_legacy.name, v4l2_i2c_drv_name_legacy, sizeof(v4l2_i2c_driver_legacy.name)); |