diff options
author | Guennadi Liakhovetski <g.liakhovetski@gmx.de> | 2011-12-05 16:01:13 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2011-12-11 09:34:00 -0200 |
commit | 4c0b036db808054f10f79e9a3d7928cf90aeb186 (patch) | |
tree | 2b3021d604eb1eb31b70f589bc165ba229bb522b /include/media/soc_camera.h | |
parent | a626f3945208af1d60d3dccf064cac3b15bc54ca (diff) | |
download | linux-stable-4c0b036db808054f10f79e9a3d7928cf90aeb186.tar.gz linux-stable-4c0b036db808054f10f79e9a3d7928cf90aeb186.tar.bz2 linux-stable-4c0b036db808054f10f79e9a3d7928cf90aeb186.zip |
[media] V4L: soc-camera: fix compiler warnings on 64-bit platforms
On 64-bit platforms assigning a pointer to a 32-bit variable causes a
compiler warning and cannot actually work. Soc-camera currently doesn't
support any 64-bit systems, but such platforms can be added in the
and in any case compiler warnings should be avoided.
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Acked-by: Janusz Krzysztofik <jkrzyszt@tis.icnet.pl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'include/media/soc_camera.h')
-rw-r--r-- | include/media/soc_camera.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/include/media/soc_camera.h b/include/media/soc_camera.h index b1377b931eb7..5fb2c3d10c05 100644 --- a/include/media/soc_camera.h +++ b/include/media/soc_camera.h @@ -254,7 +254,7 @@ unsigned long soc_camera_apply_board_flags(struct soc_camera_link *icl, static inline struct video_device *soc_camera_i2c_to_vdev(const struct i2c_client *client) { struct v4l2_subdev *sd = i2c_get_clientdata(client); - struct soc_camera_device *icd = (struct soc_camera_device *)sd->grp_id; + struct soc_camera_device *icd = v4l2_get_subdev_hostdata(sd); return icd ? icd->vdev : NULL; } @@ -279,6 +279,11 @@ static inline struct soc_camera_device *soc_camera_from_vbq(const struct videobu return container_of(vq, struct soc_camera_device, vb_vidq); } +static inline u32 soc_camera_grp_id(const struct soc_camera_device *icd) +{ + return (icd->iface << 8) | (icd->devnum + 1); +} + void soc_camera_lock(struct vb2_queue *vq); void soc_camera_unlock(struct vb2_queue *vq); |