aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/ov5642.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/ov5642.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/ov5642.c')
-rw-r--r--drivers/media/video/ov5642.c17
1 files changed, 4 insertions, 13 deletions
diff --git a/drivers/media/video/ov5642.c b/drivers/media/video/ov5642.c
index 163a6f7ff8ef..2a26602fc86d 100644
--- a/drivers/media/video/ov5642.c
+++ b/drivers/media/video/ov5642.c
@@ -889,8 +889,7 @@ static struct v4l2_subdev_ops ov5642_subdev_ops = {
889 .video = &ov5642_subdev_video_ops, 889 .video = &ov5642_subdev_video_ops,
890}; 890};
891 891
892static int ov5642_video_probe(struct soc_camera_device *icd, 892static int ov5642_video_probe(struct i2c_client *client)
893 struct i2c_client *client)
894{ 893{
895 int ret; 894 int ret;
896 u8 id_high, id_low; 895 u8 id_high, id_low;
@@ -921,16 +920,9 @@ static int ov5642_probe(struct i2c_client *client,
921 const struct i2c_device_id *did) 920 const struct i2c_device_id *did)
922{ 921{
923 struct ov5642 *priv; 922 struct ov5642 *priv;
924 struct soc_camera_device *icd = client->dev.platform_data; 923 struct soc_camera_link *icl = soc_camera_i2c_to_link(client);
925 struct soc_camera_link *icl;
926 int ret; 924 int ret;
927 925
928 if (!icd) {
929 dev_err(&client->dev, "OV5642: missing soc-camera data!\n");
930 return -EINVAL;
931 }
932
933 icl = to_soc_camera_link(icd);
934 if (!icl) { 926 if (!icl) {
935 dev_err(&client->dev, "OV5642: missing platform data!\n"); 927 dev_err(&client->dev, "OV5642: missing platform data!\n");
936 return -EINVAL; 928 return -EINVAL;
@@ -944,7 +936,7 @@ static int ov5642_probe(struct i2c_client *client,
944 936
945 priv->fmt = &ov5642_colour_fmts[0]; 937 priv->fmt = &ov5642_colour_fmts[0];
946 938
947 ret = ov5642_video_probe(icd, client); 939 ret = ov5642_video_probe(client);
948 if (ret < 0) 940 if (ret < 0)
949 goto error; 941 goto error;
950 942
@@ -958,8 +950,7 @@ error:
958static int ov5642_remove(struct i2c_client *client) 950static int ov5642_remove(struct i2c_client *client)
959{ 951{
960 struct ov5642 *priv = to_ov5642(client); 952 struct ov5642 *priv = to_ov5642(client);
961 struct soc_camera_device *icd = client->dev.platform_data; 953 struct soc_camera_link *icl = soc_camera_i2c_to_link(client);
962 struct soc_camera_link *icl = to_soc_camera_link(icd);
963 954
964 if (icl->free_bus) 955 if (icl->free_bus)
965 icl->free_bus(icl); 956 icl->free_bus(icl);