summaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
authorDavid Cohen <dacohen@gmail.com>2010-12-08 09:13:59 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-12-30 22:29:21 -0200
commit63c9718c1a4595d51f5b70ed4aed6cee5aea875b (patch)
treeb60410695015c77940e9065dccbe831d88e022ed /drivers/media
parentf7b74f76a3a5bcad4d2e8db76834253a63977545 (diff)
[media] ov9640: fix OmniVision OV9640 sensor driver's priv data retrieving
OmniVision OV9640 driver wasn't requesting properly its private data on I2C remove and video_probe functions. It was retrieving the V4L2 subdev struct address instead of priv struct's one. This patch fixes such problem. Signed-off-by: David Cohen <dacohen@gmail.com> Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/video/ov9640.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/media/video/ov9640.c b/drivers/media/video/ov9640.c
index c6d8e8a88d2..53d88a2ab92 100644
--- a/drivers/media/video/ov9640.c
+++ b/drivers/media/video/ov9640.c
@@ -651,7 +651,8 @@ static int ov9640_cropcap(struct v4l2_subdev *sd, struct v4l2_cropcap *a)
static int ov9640_video_probe(struct soc_camera_device *icd,
struct i2c_client *client)
{
- struct ov9640_priv *priv = i2c_get_clientdata(client);
+ struct v4l2_subdev *sd = i2c_get_clientdata(client);
+ struct ov9640_priv *priv = to_ov9640_sensor(sd);
u8 pid, ver, midh, midl;
const char *devname;
int ret = 0;
@@ -788,7 +789,8 @@ static int ov9640_probe(struct i2c_client *client,
static int ov9640_remove(struct i2c_client *client)
{
- struct ov9640_priv *priv = i2c_get_clientdata(client);
+ struct v4l2_subdev *sd = i2c_get_clientdata(client);
+ struct ov9640_priv *priv = to_ov9640_sensor(sd);
kfree(priv);
return 0;