From d352bcc99067d8e5caf2c8794d0dd9e63f835e1a Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Tue, 22 Jul 2014 01:40:00 -0300 Subject: [media] v4l2-subdev: Fix compilation when !VIDEO_V4L2_SUBDEV_API As reported by Kbuildtest: drivers/media/v4l2-core/v4l2-subdev.c: In function 'check_format': drivers/media/v4l2-core/v4l2-subdev.c:136:23: error: 'struct v4l2_subdev' has no member named 'entity' if (format->pad >= sd->entity.num_pads) ^ drivers/media/v4l2-core/v4l2-subdev.c: In function 'check_crop': drivers/media/v4l2-core/v4l2-subdev.c:148:21: error: 'struct v4l2_subdev' has no member named 'entity' if (crop->pad >= sd->entity.num_pads) ^ drivers/media/v4l2-core/v4l2-subdev.c: In function 'check_selection': drivers/media/v4l2-core/v4l2-subdev.c:161:20: error: 'struct v4l2_subdev' has no member named 'entity' if (sel->pad >= sd->entity.num_pads) ^ drivers/media/v4l2-core/v4l2-subdev.c: In function 'check_edid': drivers/media/v4l2-core/v4l2-subdev.c:169:21: error: 'struct v4l2_subdev' has no member named 'entity' if (edid->pad >= sd->entity.num_pads) ^ drivers/media/v4l2-core/v4l2-subdev.c: In function 'subdev_do_ioctl': >> drivers/media/v4l2-core/v4l2-subdev.c:186:6: warning: unused variable 'rval' [-Wunused-variable] int rval; ^ drivers/media/v4l2-core/v4l2-subdev.c: At top level: drivers/media/v4l2-core/v4l2-subdev.c:129:12: warning: 'check_format' defined but not used [-Wunused-function] static int check_format(struct v4l2_subdev *sd, ^ drivers/media/v4l2-core/v4l2-subdev.c:142:12: warning: 'check_crop' defined but not used [-Wunused-function] static int check_crop(struct v4l2_subdev *sd, struct v4l2_subdev_crop *crop) ^ drivers/media/v4l2-core/v4l2-subdev.c:154:12: warning: 'check_selection' defined but not used [-Wunused-function] static int check_selection(struct v4l2_subdev *sd, ^ drivers/media/v4l2-core/v4l2-subdev.c:167:12: warning: 'check_edid' defined but not used [-Wunused-function] static int check_edid(struct v4l2_subdev *sd, struct v4l2_subdev_edid *edid) The above warnins happen because those functions are used only when the V4L2 subdev API is enabled. Reported-by: kbuild test robot Cc: Laurent Pinchart Signed-off-by: Mauro Carvalho Chehab --- drivers/media/v4l2-core/v4l2-subdev.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'drivers/media/v4l2-core/v4l2-subdev.c') diff --git a/drivers/media/v4l2-core/v4l2-subdev.c b/drivers/media/v4l2-core/v4l2-subdev.c index b92cf6958331..b4d235c13fbf 100644 --- a/drivers/media/v4l2-core/v4l2-subdev.c +++ b/drivers/media/v4l2-core/v4l2-subdev.c @@ -126,6 +126,7 @@ static int subdev_close(struct file *file) return 0; } +#if defined(CONFIG_VIDEO_V4L2_SUBDEV_API) static int check_format(struct v4l2_subdev *sd, struct v4l2_subdev_format *format) { @@ -174,6 +175,7 @@ static int check_edid(struct v4l2_subdev *sd, struct v4l2_subdev_edid *edid) return 0; } +#endif static long subdev_do_ioctl(struct file *file, unsigned int cmd, void *arg) { @@ -182,8 +184,8 @@ static long subdev_do_ioctl(struct file *file, unsigned int cmd, void *arg) struct v4l2_fh *vfh = file->private_data; #if defined(CONFIG_VIDEO_V4L2_SUBDEV_API) struct v4l2_subdev_fh *subdev_fh = to_v4l2_subdev_fh(vfh); -#endif int rval; +#endif switch (cmd) { case VIDIOC_QUERYCTRL: -- cgit