Skip to content

Commit

Permalink
V4L/DVB (11372): v4l2: use old-style i2c API for kernels < 2.6.26 ins…
Browse files Browse the repository at this point in the history
…tead of < 2.6.22

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.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
  • Loading branch information
Hans Verkuil authored and Mauro Carvalho Chehab committed Apr 7, 2009
1 parent 0c84674 commit acebc70
Show file tree
Hide file tree
Showing 6 changed files with 1 addition and 6 deletions.
1 change: 0 additions & 1 deletion drivers/media/video/tda9840.c
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,6 @@ static int tda9840_remove(struct i2c_client *client)
return 0;
}


static const struct i2c_device_id tda9840_id[] = {
{ "tda9840", 0 },
{ }
Expand Down
1 change: 0 additions & 1 deletion drivers/media/video/tea6415c.c
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,6 @@ static int tea6415c_remove(struct i2c_client *client)
return 0;
}


static const struct i2c_device_id tea6415c_id[] = {
{ "tea6415c", 0 },
{ }
Expand Down
1 change: 0 additions & 1 deletion drivers/media/video/tea6420.c
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,6 @@ static int tea6420_remove(struct i2c_client *client)
return 0;
}


static const struct i2c_device_id tea6420_id[] = {
{ "tea6420", 0 },
{ }
Expand Down
1 change: 0 additions & 1 deletion drivers/media/video/tuner-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1164,7 +1164,6 @@ static int tuner_probe(struct i2c_client *client,
return 0;
}


static int tuner_remove(struct i2c_client *client)
{
struct tuner *t = to_tuner(i2c_get_clientdata(client));
Expand Down
1 change: 0 additions & 1 deletion drivers/media/video/tvaudio.c
Original file line number Diff line number Diff line change
Expand Up @@ -2069,7 +2069,6 @@ static int tvaudio_remove(struct i2c_client *client)
return 0;
}


/* This driver supports many devices and the idea is to let the driver
detect which device is present. So rather than listing all supported
devices here, we pretend to support a single, fake device type. */
Expand Down
2 changes: 1 addition & 1 deletion include/media/v4l2-i2c-drv.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ static struct v4l2_i2c_driver_data v4l2_i2c_data;
static struct i2c_driver v4l2_i2c_driver;


/* 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)
{
Expand Down

0 comments on commit acebc70

Please sign in to comment.