From 0c9940b6b68e95f4f47eed6ff21d3508051645fc Mon Sep 17 00:00:00 2001 From: Hans Verkuil Date: Sun, 29 Mar 2009 22:56:18 +0200 Subject: tvaudio: remove i2c legacy code From: Hans Verkuil All drivers that use tvaudio now use v4l2_subdev, so we can remove the legacy code from tvaudio. Priority: normal Signed-off-by: Hans Verkuil --- linux/drivers/media/video/tvaudio.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'linux') diff --git a/linux/drivers/media/video/tvaudio.c b/linux/drivers/media/video/tvaudio.c index 39d796908..28caf6ef3 100644 --- a/linux/drivers/media/video/tvaudio.c +++ b/linux/drivers/media/video/tvaudio.c @@ -38,7 +38,7 @@ #include #include #include -#include +#include #include @@ -139,6 +139,7 @@ static inline struct CHIPSTATE *to_state(struct v4l2_subdev *sd) return container_of(sd, struct CHIPSTATE, sd); } +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 22) /* ---------------------------------------------------------------------- */ /* i2c addresses */ @@ -153,6 +154,7 @@ static unsigned short normal_i2c[] = { I2C_ADDR_PIC16C54 >> 1, I2C_CLIENT_END }; I2C_CLIENT_INSMOD; +#endif /* ---------------------------------------------------------------------- */ /* i2c I/O functions */ @@ -1926,11 +1928,6 @@ static int tvaudio_g_chip_ident(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ide return v4l2_chip_ident_i2c_client(client, chip, V4L2_IDENT_TVAUDIO, 0); } -static int tvaudio_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 tvaudio_core_ops = { @@ -2100,6 +2097,7 @@ static int tvaudio_remove(struct i2c_client *client) return 0; } +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 22) static int tvaudio_legacy_probe(struct i2c_adapter *adap) { /* don't attach on saa7146 based cards, @@ -2110,6 +2108,7 @@ static int tvaudio_legacy_probe(struct i2c_adapter *adap) return 1; return 0; } +#endif #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 26) /* This driver supports many devices and the idea is to let the driver @@ -2124,11 +2123,11 @@ MODULE_DEVICE_TABLE(i2c, tvaudio_id); static struct v4l2_i2c_driver_data v4l2_i2c_data = { .name = "tvaudio", - .driverid = I2C_DRIVERID_TVAUDIO, - .command = tvaudio_command, .probe = tvaudio_probe, .remove = tvaudio_remove, +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 22) .legacy_probe = tvaudio_legacy_probe, +#endif #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 26) .id_table = tvaudio_id, #endif -- cgit v1.2.3