]> git.karo-electronics.de Git - linux-beck.git/commitdiff
[media] v4l2-subdev: Fix compilation when !VIDEO_V4L2_SUBDEV_API
authorMauro Carvalho Chehab <m.chehab@samsung.com>
Tue, 22 Jul 2014 04:40:00 +0000 (01:40 -0300)
committerMauro Carvalho Chehab <m.chehab@samsung.com>
Tue, 22 Jul 2014 04:44:55 +0000 (01:44 -0300)
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 <fengguang.wu@intel.com>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
drivers/media/v4l2-core/v4l2-subdev.c

index b92cf6958331a8f3b9b6023a5427ebd2abea878a..b4d235c13fbfc43d12decce919e9dc367e094ea5 100644 (file)
@@ -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: