Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 320128
b: refs/heads/master
c: f18d8e0
h: refs/heads/master
v: v3
  • Loading branch information
Hans Verkuil authored and Mauro Carvalho Chehab committed Jul 6, 2012
1 parent 386170a commit 6a6f002
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 23 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 458aa4a6922bf4cc22a34adfe3bd56331bbf663e
refs/heads/master: f18d8e07b28e2950679edaa4edaa7ce410dd57fc
35 changes: 13 additions & 22 deletions trunk/drivers/media/video/v4l2-ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -855,6 +855,11 @@ static void v4l_print_newline(const void *arg, bool write_only)
pr_cont("\n");
}

static void v4l_print_default(const void *arg, bool write_only)
{
pr_cont("driver-specific ioctl\n");
}

static int check_ext_ctrls(struct v4l2_ext_controls *c, int allow_priv)
{
__u32 i;
Expand Down Expand Up @@ -1839,12 +1844,6 @@ struct v4l2_ioctl_info {
sizeof(((struct v4l2_struct *)0)->field)) << 16)
#define INFO_FL_CLEAR_MASK (_IOC_SIZEMASK << 16)

#define IOCTL_INFO(_ioctl, _flags) [_IOC_NR(_ioctl)] = { \
.ioctl = _ioctl, \
.flags = _flags, \
.name = #_ioctl, \
}

#define IOCTL_INFO_STD(_ioctl, _vidioc, _debug, _flags) \
[_IOC_NR(_ioctl)] = { \
.ioctl = _ioctl, \
Expand Down Expand Up @@ -2028,12 +2027,12 @@ static long __video_do_ioctl(struct file *file,
} else {
default_info.ioctl = cmd;
default_info.flags = 0;
default_info.debug = NULL;
default_info.debug = v4l_print_default;
info = &default_info;
}

write_only = _IOC_DIR(cmd) == _IOC_WRITE;
if (info->debug && write_only && vfd->debug > V4L2_DEBUG_IOCTL) {
if (write_only && vfd->debug > V4L2_DEBUG_IOCTL) {
v4l_print_ioctl(vfd->name, cmd);
pr_cont(": ");
info->debug(arg, write_only);
Expand All @@ -2044,22 +2043,16 @@ static long __video_do_ioctl(struct file *file,
const vidioc_op *vidioc = p + info->offset;

ret = (*vidioc)(file, fh, arg);
goto done;
} else if (info->flags & INFO_FL_FUNC) {
ret = info->func(ops, file, fh, arg);
goto done;
} else if (!ops->vidioc_default) {
ret = -ENOTTY;
} else {
ret = ops->vidioc_default(file, fh,
use_fh_prio ? v4l2_prio_check(vfd->prio, vfh->prio) >= 0 : 0,
cmd, arg);
}

switch (cmd) {
default:
if (!ops->vidioc_default)
break;
ret = ops->vidioc_default(file, fh, use_fh_prio ?
v4l2_prio_check(vfd->prio, vfh->prio) >= 0 : 0,
cmd, arg);
break;
} /* switch */

done:
if (vfd->debug) {
if (write_only && vfd->debug > V4L2_DEBUG_IOCTL) {
Expand All @@ -2073,8 +2066,6 @@ static long __video_do_ioctl(struct file *file,
pr_cont(": error %ld\n", ret);
else if (vfd->debug == V4L2_DEBUG_IOCTL)
pr_cont("\n");
else if (!info->debug)
return ret;
else if (_IOC_DIR(cmd) == _IOC_NONE)
info->debug(arg, write_only);
else {
Expand Down

0 comments on commit 6a6f002

Please sign in to comment.