aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/v4l2-core
diff options
context:
space:
mode:
authorHans Verkuil <hans.verkuil@cisco.com>2013-03-14 06:40:45 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2013-03-24 07:47:16 -0400
commit505d04bdc43a6a6c828835e90ab5fcb380d631d5 (patch)
tree9530f5e321e979ef2ae8c905b852983382033b22 /drivers/media/v4l2-core
parent977ba3b1b73f24fae2d0c8bd59d7a4696f1e0ccc (diff)
[media] v4l2-ioctl: simplify debug code
The core debug code can now be simplified since all the write-only ioctls are now const and will not modify the data they pass to the drivers. So instead of logging write-only ioctls before the driver is called this can now be done afterwards, which is cleaner when it comes to error reporting as well. This also fixes a logic error in the debugging code where there was one 'else' too many. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/v4l2-core')
-rw-r--r--drivers/media/v4l2-core/v4l2-ioctl.c15
1 files changed, 2 insertions, 13 deletions
diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c b/drivers/media/v4l2-core/v4l2-ioctl.c
index 936ca25bd5be..168b51e193cd 100644
--- a/drivers/media/v4l2-core/v4l2-ioctl.c
+++ b/drivers/media/v4l2-core/v4l2-ioctl.c
@@ -2155,11 +2155,6 @@ static long __video_do_ioctl(struct file *file,
2155 } 2155 }
2156 2156
2157 write_only = _IOC_DIR(cmd) == _IOC_WRITE; 2157 write_only = _IOC_DIR(cmd) == _IOC_WRITE;
2158 if (write_only && debug > V4L2_DEBUG_IOCTL) {
2159 v4l_printk_ioctl(video_device_node_name(vfd), cmd);
2160 pr_cont(": ");
2161 info->debug(arg, write_only);
2162 }
2163 if (info->flags & INFO_FL_STD) { 2158 if (info->flags & INFO_FL_STD) {
2164 typedef int (*vidioc_op)(struct file *file, void *fh, void *p); 2159 typedef int (*vidioc_op)(struct file *file, void *fh, void *p);
2165 const void *p = vfd->ioctl_ops; 2160 const void *p = vfd->ioctl_ops;
@@ -2178,16 +2173,10 @@ static long __video_do_ioctl(struct file *file,
2178 2173
2179done: 2174done:
2180 if (debug) { 2175 if (debug) {
2181 if (write_only && debug > V4L2_DEBUG_IOCTL) {
2182 if (ret < 0)
2183 printk(KERN_DEBUG "%s: error %ld\n",
2184 video_device_node_name(vfd), ret);
2185 return ret;
2186 }
2187 v4l_printk_ioctl(video_device_node_name(vfd), cmd); 2176 v4l_printk_ioctl(video_device_node_name(vfd), cmd);
2188 if (ret < 0) 2177 if (ret < 0)
2189 pr_cont(": error %ld\n", ret); 2178 pr_cont(": error %ld", ret);
2190 else if (debug == V4L2_DEBUG_IOCTL) 2179 if (debug == V4L2_DEBUG_IOCTL)
2191 pr_cont("\n"); 2180 pr_cont("\n");
2192 else if (_IOC_DIR(cmd) == _IOC_NONE) 2181 else if (_IOC_DIR(cmd) == _IOC_NONE)
2193 info->debug(arg, write_only); 2182 info->debug(arg, write_only);