aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/cx88/cx88-i2c.c
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2009-03-14 11:40:51 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-03-30 11:43:23 -0400
commit9467fe126451c7fc7878d21f3cd1938421ef972e (patch)
tree298d0aebb8328829a4b41729e817ccc1fff9c298 /drivers/media/video/cx88/cx88-i2c.c
parent74fc7bd9cec0ccdbea23659208492ec7ffc58297 (diff)
V4L/DVB (11047): cx88: 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/cx88/cx88-i2c.c')
-rw-r--r--drivers/media/video/cx88/cx88-i2c.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/media/video/cx88/cx88-i2c.c b/drivers/media/video/cx88/cx88-i2c.c
index c0ff2305d804..4a17a7579323 100644
--- a/drivers/media/video/cx88/cx88-i2c.c
+++ b/drivers/media/video/cx88/cx88-i2c.c
@@ -99,7 +99,8 @@ static int cx8800_bit_getsda(void *data)
99 99
100static int attach_inform(struct i2c_client *client) 100static int attach_inform(struct i2c_client *client)
101{ 101{
102 struct cx88_core *core = i2c_get_adapdata(client->adapter); 102 struct v4l2_device *v4l2_dev = i2c_get_adapdata(client->adapter);
103 struct cx88_core *core = to_core(v4l2_dev);
103 104
104 dprintk(1, "%s i2c attach [addr=0x%x,client=%s]\n", 105 dprintk(1, "%s i2c attach [addr=0x%x,client=%s]\n",
105 client->driver->driver.name, client->addr, client->name); 106 client->driver->driver.name, client->addr, client->name);
@@ -108,7 +109,8 @@ static int attach_inform(struct i2c_client *client)
108 109
109static int detach_inform(struct i2c_client *client) 110static int detach_inform(struct i2c_client *client)
110{ 111{
111 struct cx88_core *core = i2c_get_adapdata(client->adapter); 112 struct v4l2_device *v4l2_dev = i2c_get_adapdata(client->adapter);
113 struct cx88_core *core = to_core(v4l2_dev);
112 114
113 dprintk(1, "i2c detach [client=%s]\n", client->name); 115 dprintk(1, "i2c detach [client=%s]\n", client->name);
114 return 0; 116 return 0;
@@ -186,7 +188,7 @@ int cx88_i2c_init(struct cx88_core *core, struct pci_dev *pci)
186 core->i2c_adap.client_unregister = detach_inform; 188 core->i2c_adap.client_unregister = detach_inform;
187 core->i2c_algo.udelay = i2c_udelay; 189 core->i2c_algo.udelay = i2c_udelay;
188 core->i2c_algo.data = core; 190 core->i2c_algo.data = core;
189 i2c_set_adapdata(&core->i2c_adap,core); 191 i2c_set_adapdata(&core->i2c_adap, &core->v4l2_dev);
190 core->i2c_adap.algo_data = &core->i2c_algo; 192 core->i2c_adap.algo_data = &core->i2c_algo;
191 core->i2c_client.adapter = &core->i2c_adap; 193 core->i2c_client.adapter = &core->i2c_adap;
192 strlcpy(core->i2c_client.name, "cx88xx internal", I2C_NAME_SIZE); 194 strlcpy(core->i2c_client.name, "cx88xx internal", I2C_NAME_SIZE);