summaryrefslogtreecommitdiff
path: root/drivers/media/video/bt8xx/bttv-i2c.c
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2009-03-14 12:36:54 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-03-30 12:43:23 -0300
commit74fc7bd9cec0ccdbea23659208492ec7ffc58297 (patch)
treecd16dbc46ec3771da456d71e2d0f27519ca9ae79 /drivers/media/video/bt8xx/bttv-i2c.c
parentf1ba28c3a6e472742cbd73b05b807684e5d56b5a (diff)
V4L/DVB (11046): bttv: convert to v4l2_device.
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/bt8xx/bttv-i2c.c')
-rw-r--r--drivers/media/video/bt8xx/bttv-i2c.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/media/video/bt8xx/bttv-i2c.c b/drivers/media/video/bt8xx/bttv-i2c.c
index 511d2bf176f1..9b66c5b09321 100644
--- a/drivers/media/video/bt8xx/bttv-i2c.c
+++ b/drivers/media/video/bt8xx/bttv-i2c.c
@@ -231,7 +231,8 @@ bttv_i2c_readbytes(struct bttv *btv, const struct i2c_msg *msg, int last)
static int bttv_i2c_xfer(struct i2c_adapter *i2c_adap, struct i2c_msg *msgs, int num)
{
- struct bttv *btv = i2c_get_adapdata(i2c_adap);
+ struct v4l2_device *v4l2_dev = i2c_get_adapdata(i2c_adap);
+ struct bttv *btv = to_bttv(v4l2_dev);
int retval = 0;
int i;
@@ -267,7 +268,8 @@ static const struct i2c_algorithm bttv_algo = {
static int attach_inform(struct i2c_client *client)
{
- struct bttv *btv = i2c_get_adapdata(client->adapter);
+ struct v4l2_device *v4l2_dev = i2c_get_adapdata(client->adapter);
+ struct bttv *btv = to_bttv(v4l2_dev);
int addr=ADDR_UNSET;
@@ -423,7 +425,7 @@ int __devinit init_bttv_i2c(struct bttv *btv)
"bt%d #%d [%s]", btv->id, btv->c.nr,
btv->use_i2c_hw ? "hw" : "sw");
- i2c_set_adapdata(&btv->c.i2c_adap, btv);
+ i2c_set_adapdata(&btv->c.i2c_adap, &btv->c.v4l2_dev);
btv->i2c_client.adapter = &btv->c.i2c_adap;
if (bttv_tvcards[btv->c.type].no_video)
@@ -439,7 +441,7 @@ int __devinit init_bttv_i2c(struct bttv *btv)
btv->i2c_rc = i2c_bit_add_bus(&btv->c.i2c_adap);
}
if (0 == btv->i2c_rc && i2c_scan)
- do_i2c_scan(btv->c.name,&btv->i2c_client);
+ do_i2c_scan(btv->c.v4l2_dev.name, &btv->i2c_client);
return btv->i2c_rc;
}