aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/v4l2-int-device.c
diff options
context:
space:
mode:
authorSakari Ailus <sakari.ailus@nokia.com>2007-07-20 12:12:51 -0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2007-10-09 21:02:57 -0400
commit63116febb9233743279a05be510ab8524f5f6242 (patch)
tree2a172ad8a12e27ce8473295b2bd730a215f06665 /drivers/media/video/v4l2-int-device.c
parentbaa05e4b454fa7d87f9a41a4bbc1f749c113ff3a (diff)
V4L/DVB (5883): V4L: Fix a compile warning on non-32-bit machines.
Fix a compile warning on non-32-bit machines in v4l2-int-device.h. Add internal ioctl interface fallback function for ioctls with one argument. Signed-off-by: Sakari Ailus <sakari.ailus@nokia.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/v4l2-int-device.c')
-rw-r--r--drivers/media/video/v4l2-int-device.c28
1 files changed, 19 insertions, 9 deletions
diff --git a/drivers/media/video/v4l2-int-device.c b/drivers/media/video/v4l2-int-device.c
index 7885d9b38c92..aa2a8156338d 100644
--- a/drivers/media/video/v4l2-int-device.c
+++ b/drivers/media/video/v4l2-int-device.c
@@ -115,13 +115,9 @@ void v4l2_int_device_unregister(struct v4l2_int_device *d)
115 mutex_unlock(&mutex); 115 mutex_unlock(&mutex);
116} 116}
117 117
118static int no_such_ioctl(struct v4l2_int_device *d)
119{
120 return -EINVAL;
121}
122
123/* Adapted from search_extable in extable.c. */ 118/* Adapted from search_extable in extable.c. */
124static v4l2_int_ioctl_func *find_ioctl(struct v4l2_int_slave *slave, int cmd) 119static v4l2_int_ioctl_func *find_ioctl(struct v4l2_int_slave *slave, int cmd,
120 v4l2_int_ioctl_func *no_such_ioctl)
125{ 121{
126 const struct v4l2_int_ioctl_desc *first = slave->ioctls; 122 const struct v4l2_int_ioctl_desc *first = slave->ioctls;
127 const struct v4l2_int_ioctl_desc *last = 123 const struct v4l2_int_ioctl_desc *last =
@@ -140,15 +136,29 @@ static v4l2_int_ioctl_func *find_ioctl(struct v4l2_int_slave *slave, int cmd)
140 return mid->func; 136 return mid->func;
141 } 137 }
142 138
143 return &no_such_ioctl; 139 return no_such_ioctl;
140}
141
142static int no_such_ioctl_0(struct v4l2_int_device *d)
143{
144 return -EINVAL;
144} 145}
145 146
146int v4l2_int_ioctl_0(struct v4l2_int_device *d, int cmd) 147int v4l2_int_ioctl_0(struct v4l2_int_device *d, int cmd)
147{ 148{
148 return ((v4l2_int_ioctl_func_0 *)find_ioctl(d->u.slave, cmd))(d); 149 return ((v4l2_int_ioctl_func_0 *)
150 find_ioctl(d->u.slave, cmd,
151 (v4l2_int_ioctl_func *)&no_such_ioctl_0))(d);
152}
153
154static int no_such_ioctl_1(struct v4l2_int_device *d, void *arg)
155{
156 return -EINVAL;
149} 157}
150 158
151int v4l2_int_ioctl_1(struct v4l2_int_device *d, int cmd, void *arg) 159int v4l2_int_ioctl_1(struct v4l2_int_device *d, int cmd, void *arg)
152{ 160{
153 return ((v4l2_int_ioctl_func_1 *)find_ioctl(d->u.slave, cmd))(d, arg); 161 return ((v4l2_int_ioctl_func_1 *)
162 find_ioctl(d->u.slave, cmd,
163 (v4l2_int_ioctl_func *)&no_such_ioctl_1))(d, arg);
154} 164}