summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/bt8xx/bttv-i2c.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2009-03-14 16:36:54 +0100
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-03-14 16:36:54 +0100
commitc5b41e23cfa080a22b48bdf0e6e2a8028f340a70 (patch)
treebe8ee90451adf9357b95565007290e3992ba8294 /linux/drivers/media/video/bt8xx/bttv-i2c.c
parent9a4b796fec5b96cb6d0f637fc86983bb376c7628 (diff)
downloadmediapointer-dvb-s2-c5b41e23cfa080a22b48bdf0e6e2a8028f340a70.tar.gz
mediapointer-dvb-s2-c5b41e23cfa080a22b48bdf0e6e2a8028f340a70.tar.bz2
bttv: convert to v4l2_device.
From: Hans Verkuil <hverkuil@xs4all.nl> Priority: normal Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'linux/drivers/media/video/bt8xx/bttv-i2c.c')
-rw-r--r--linux/drivers/media/video/bt8xx/bttv-i2c.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/linux/drivers/media/video/bt8xx/bttv-i2c.c b/linux/drivers/media/video/bt8xx/bttv-i2c.c
index 3e7812c5a..c35f09cf4 100644
--- a/linux/drivers/media/video/bt8xx/bttv-i2c.c
+++ b/linux/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;
@@ -270,7 +271,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;
@@ -430,7 +432,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)
@@ -446,7 +448,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;
}