From adfc39503d204c842da3fd2768ab84d524b7ef31 Mon Sep 17 00:00:00 2001 From: Hans Verkuil Date: Sun, 29 Mar 2009 14:04:29 +0200 Subject: tda9875: remove legacy code for old-style i2c API From: Hans Verkuil tda9875 is no longer used with the old-style i2c API, so I can remove the support for that. Priority: normal Signed-off-by: Hans Verkuil --- linux/drivers/media/video/tda9875.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'linux/drivers/media/video/tda9875.c') diff --git a/linux/drivers/media/video/tda9875.c b/linux/drivers/media/video/tda9875.c index 938bafbbd..0351b13db 100644 --- a/linux/drivers/media/video/tda9875.c +++ b/linux/drivers/media/video/tda9875.c @@ -28,7 +28,7 @@ #include #include #include -#include +#include #include #include "compat.h" @@ -36,6 +36,7 @@ static int debug; /* insmod parameter */ module_param(debug, int, S_IRUGO | S_IWUSR); MODULE_LICENSE("GPL"); +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 22) /* Addresses to scan */ static unsigned short normal_i2c[] = { I2C_ADDR_TDA9875 >> 1, @@ -43,6 +44,7 @@ static unsigned short normal_i2c[] = { }; I2C_CLIENT_INSMOD; +#endif /* This is a superset of the TDA9875 */ struct tda9875 { @@ -335,11 +337,6 @@ static int tda9875_queryctrl(struct v4l2_subdev *sd, struct v4l2_queryctrl *qc) return -EINVAL; } -static int tda9875_command(struct i2c_client *client, unsigned cmd, void *arg) -{ - return v4l2_subdev_command(i2c_get_clientdata(client), cmd, arg); -} - /* ----------------------------------------------------------------------- */ static const struct v4l2_subdev_core_ops tda9875_core_ops = { @@ -418,7 +415,6 @@ MODULE_DEVICE_TABLE(i2c, tda9875_id); #endif static struct v4l2_i2c_driver_data v4l2_i2c_data = { .name = "tda9875", - .command = tda9875_command, .probe = tda9875_probe, .remove = tda9875_remove, #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 26) -- cgit v1.2.3 From 1784ea5527ed756f946958f45f74d1f15797c366 Mon Sep 17 00:00:00 2001 From: Hans Verkuil Date: Mon, 30 Mar 2009 01:04:44 +0200 Subject: v4l2: use old-style i2c API for kernels < 2.6.26 instead of < 2.6.22 From: Hans Verkuil Originally the intention was to switch to the new style i2c API starting with the introduction of the API in 2.6.22. However, the i2c_new_probed_device() function has a lethal bug that wasn't fixed until 2.6.25. Or more accurately, it was only fixed in the stable series of 2.6.25 and 2.6.26. Given the fact that the new i2c API also changed starting with 2.6.26 (the addition of i2c_device_id), it is easiest to switch APIs starting with 2.6.26. This patch updates all the legacy code accordingly. Priority: normal Signed-off-by: Hans Verkuil --- linux/drivers/media/video/tda9875.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'linux/drivers/media/video/tda9875.c') diff --git a/linux/drivers/media/video/tda9875.c b/linux/drivers/media/video/tda9875.c index 0351b13db..550c8b348 100644 --- a/linux/drivers/media/video/tda9875.c +++ b/linux/drivers/media/video/tda9875.c @@ -36,7 +36,7 @@ static int debug; /* insmod parameter */ module_param(debug, int, S_IRUGO | S_IWUSR); MODULE_LICENSE("GPL"); -#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 22) +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 26) /* Addresses to scan */ static unsigned short normal_i2c[] = { I2C_ADDR_TDA9875 >> 1, -- cgit v1.2.3