[PATCH 1/1] mt9t031: Fix panic on probe

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The video device is not yet valid when probe() is called.
Call directly soc_camera_power_on/off() instead of calling mt9t031_s_power().

Signed-off-by: Philippe Rétornaz <philippe.retornaz@xxxxxxx>
---
 drivers/media/i2c/soc_camera/mt9t031.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/media/i2c/soc_camera/mt9t031.c b/drivers/media/i2c/soc_camera/mt9t031.c
index d80d044..71c0b16 100644
--- a/drivers/media/i2c/soc_camera/mt9t031.c
+++ b/drivers/media/i2c/soc_camera/mt9t031.c
@@ -632,10 +632,11 @@ static int mt9t031_s_power(struct v4l2_subdev *sd, int on)
 static int mt9t031_video_probe(struct i2c_client *client)
 {
 	struct mt9t031 *mt9t031 = to_mt9t031(client);
+	struct soc_camera_subdev_desc *ssdd = soc_camera_i2c_to_desc(client);
 	s32 data;
 	int ret;
 
-	ret = mt9t031_s_power(&mt9t031->subdev, 1);
+	ret = soc_camera_power_on(&client->dev, ssdd);
 	if (ret < 0)
 		return ret;
 
@@ -664,7 +665,7 @@ static int mt9t031_video_probe(struct i2c_client *client)
 	ret = v4l2_ctrl_handler_setup(&mt9t031->hdl);
 
 done:
-	mt9t031_s_power(&mt9t031->subdev, 0);
+	soc_camera_power_off(&client->dev, ssdd);
 
 	return ret;
 }
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux