Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 63c9718c authored by David Cohen's avatar David Cohen Committed by Mauro Carvalho Chehab
Browse files

[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: default avatarDavid Cohen <dacohen@gmail.com>
Signed-off-by: default avatarGuennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent f7b74f76
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -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;