Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 65662
b: refs/heads/master
c: 63116fe
h: refs/heads/master
v: v3
  • Loading branch information
Sakari Ailus authored and Mauro Carvalho Chehab committed Oct 10, 2007
1 parent 865804d commit 339d0b6
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 11 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: baa05e4b454fa7d87f9a41a4bbc1f749c113ff3a
refs/heads/master: 63116febb9233743279a05be510ab8524f5f6242
28 changes: 19 additions & 9 deletions trunk/drivers/media/video/v4l2-int-device.c
Original file line number Diff line number Diff line change
Expand Up @@ -115,13 +115,9 @@ void v4l2_int_device_unregister(struct v4l2_int_device *d)
mutex_unlock(&mutex);
}

static int no_such_ioctl(struct v4l2_int_device *d)
{
return -EINVAL;
}

/* Adapted from search_extable in extable.c. */
static v4l2_int_ioctl_func *find_ioctl(struct v4l2_int_slave *slave, int cmd)
static v4l2_int_ioctl_func *find_ioctl(struct v4l2_int_slave *slave, int cmd,
v4l2_int_ioctl_func *no_such_ioctl)
{
const struct v4l2_int_ioctl_desc *first = slave->ioctls;
const struct v4l2_int_ioctl_desc *last =
Expand All @@ -140,15 +136,29 @@ static v4l2_int_ioctl_func *find_ioctl(struct v4l2_int_slave *slave, int cmd)
return mid->func;
}

return &no_such_ioctl;
return no_such_ioctl;
}

static int no_such_ioctl_0(struct v4l2_int_device *d)
{
return -EINVAL;
}

int v4l2_int_ioctl_0(struct v4l2_int_device *d, int cmd)
{
return ((v4l2_int_ioctl_func_0 *)find_ioctl(d->u.slave, cmd))(d);
return ((v4l2_int_ioctl_func_0 *)
find_ioctl(d->u.slave, cmd,
(v4l2_int_ioctl_func *)&no_such_ioctl_0))(d);
}

static int no_such_ioctl_1(struct v4l2_int_device *d, void *arg)
{
return -EINVAL;
}

int v4l2_int_ioctl_1(struct v4l2_int_device *d, int cmd, void *arg)
{
return ((v4l2_int_ioctl_func_1 *)find_ioctl(d->u.slave, cmd))(d, arg);
return ((v4l2_int_ioctl_func_1 *)
find_ioctl(d->u.slave, cmd,
(v4l2_int_ioctl_func *)&no_such_ioctl_1))(d, arg);
}
2 changes: 1 addition & 1 deletion trunk/include/media/v4l2-int-device.h
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ int v4l2_int_ioctl_1(struct v4l2_int_device *d, int cmd, void *arg);
arg_type asterisk arg) \
{ \
return v4l2_int_ioctl_1(d, vidioc_int_##name##_num, \
(void *)arg); \
(void *)(unsigned long)arg); \
} \
\
static inline struct v4l2_int_ioctl_desc \
Expand Down

0 comments on commit 339d0b6

Please sign in to comment.