aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/ov9640.c
diff options
context:
space:
mode:
authorGuennadi Liakhovetski <g.liakhovetski@gmx.de>2011-09-21 14:16:30 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2011-11-03 16:28:58 -0400
commit14178aa57ce6ac4f05b4df8ea9e010486ce83a76 (patch)
tree992b8ae46ddad4f16c0d5d7b8fa3ab2a84b4e50e /drivers/media/video/ov9640.c
parent09362ec25c3f42d00a4008d0622bfbca68e540f5 (diff)
[media] V4L: soc-camera: start removing struct soc_camera_device from client drivers
Remove most trivial uses of struct soc_camera_device from most client drivers, abstracting some of them inside inline functions. Next steps will eliminate remaining uses and modify inline functions to not use struct soc_camera_device. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/ov9640.c')
-rw-r--r--drivers/media/video/ov9640.c21
1 files changed, 4 insertions, 17 deletions
diff --git a/drivers/media/video/ov9640.c b/drivers/media/video/ov9640.c
index 12d33a9c07b0..f9babf39d802 100644
--- a/drivers/media/video/ov9640.c
+++ b/drivers/media/video/ov9640.c
@@ -578,8 +578,7 @@ static int ov9640_cropcap(struct v4l2_subdev *sd, struct v4l2_cropcap *a)
578 return 0; 578 return 0;
579} 579}
580 580
581static int ov9640_video_probe(struct soc_camera_device *icd, 581static int ov9640_video_probe(struct i2c_client *client)
582 struct i2c_client *client)
583{ 582{
584 struct v4l2_subdev *sd = i2c_get_clientdata(client); 583 struct v4l2_subdev *sd = i2c_get_clientdata(client);
585 struct ov9640_priv *priv = to_ov9640_sensor(sd); 584 struct ov9640_priv *priv = to_ov9640_sensor(sd);
@@ -587,10 +586,6 @@ static int ov9640_video_probe(struct soc_camera_device *icd,
587 const char *devname; 586 const char *devname;
588 int ret = 0; 587 int ret = 0;
589 588
590 /* We must have a parent by now. And it cannot be a wrong one. */
591 BUG_ON(!icd->parent ||
592 to_soc_camera_host(icd->parent)->nr != icd->iface);
593
594 /* 589 /*
595 * check and show product ID and manufacturer ID 590 * check and show product ID and manufacturer ID
596 */ 591 */
@@ -644,8 +639,7 @@ static int ov9640_g_mbus_config(struct v4l2_subdev *sd,
644 struct v4l2_mbus_config *cfg) 639 struct v4l2_mbus_config *cfg)
645{ 640{
646 struct i2c_client *client = v4l2_get_subdevdata(sd); 641 struct i2c_client *client = v4l2_get_subdevdata(sd);
647 struct soc_camera_device *icd = client->dev.platform_data; 642 struct soc_camera_link *icl = soc_camera_i2c_to_link(client);
648 struct soc_camera_link *icl = to_soc_camera_link(icd);
649 643
650 cfg->flags = V4L2_MBUS_PCLK_SAMPLE_RISING | V4L2_MBUS_MASTER | 644 cfg->flags = V4L2_MBUS_PCLK_SAMPLE_RISING | V4L2_MBUS_MASTER |
651 V4L2_MBUS_VSYNC_ACTIVE_HIGH | V4L2_MBUS_HSYNC_ACTIVE_HIGH | 645 V4L2_MBUS_VSYNC_ACTIVE_HIGH | V4L2_MBUS_HSYNC_ACTIVE_HIGH |
@@ -678,16 +672,9 @@ static int ov9640_probe(struct i2c_client *client,
678 const struct i2c_device_id *did) 672 const struct i2c_device_id *did)
679{ 673{
680 struct ov9640_priv *priv; 674 struct ov9640_priv *priv;
681 struct soc_camera_device *icd = client->dev.platform_data; 675 struct soc_camera_link *icl = soc_camera_i2c_to_link(client);
682 struct soc_camera_link *icl;
683 int ret; 676 int ret;
684 677
685 if (!icd) {
686 dev_err(&client->dev, "Missing soc-camera data!\n");
687 return -EINVAL;
688 }
689
690 icl = to_soc_camera_link(icd);
691 if (!icl) { 678 if (!icl) {
692 dev_err(&client->dev, "Missing platform_data for driver\n"); 679 dev_err(&client->dev, "Missing platform_data for driver\n");
693 return -EINVAL; 680 return -EINVAL;
@@ -715,7 +702,7 @@ static int ov9640_probe(struct i2c_client *client,
715 return err; 702 return err;
716 } 703 }
717 704
718 ret = ov9640_video_probe(icd, client); 705 ret = ov9640_video_probe(client);
719 706
720 if (ret) { 707 if (ret) {
721 v4l2_ctrl_handler_free(&priv->hdl); 708 v4l2_ctrl_handler_free(&priv->hdl);