diff options
Diffstat (limited to 'meta/recipes-kernel/linux/linux-omap-2.6.29/isp/v4l/0003-V4L-Int-if-Dummy-slave.patch')
-rw-r--r-- | meta/recipes-kernel/linux/linux-omap-2.6.29/isp/v4l/0003-V4L-Int-if-Dummy-slave.patch | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/meta/recipes-kernel/linux/linux-omap-2.6.29/isp/v4l/0003-V4L-Int-if-Dummy-slave.patch b/meta/recipes-kernel/linux/linux-omap-2.6.29/isp/v4l/0003-V4L-Int-if-Dummy-slave.patch new file mode 100644 index 0000000000..829810fab0 --- /dev/null +++ b/meta/recipes-kernel/linux/linux-omap-2.6.29/isp/v4l/0003-V4L-Int-if-Dummy-slave.patch | |||
@@ -0,0 +1,61 @@ | |||
1 | From cc1d76e0f50321e80f7f50e9e214de2c9a45628a Mon Sep 17 00:00:00 2001 | ||
2 | From: Sakari Ailus <sakari.ailus@nokia.com> | ||
3 | Date: Wed, 22 Oct 2008 18:41:20 +0300 | ||
4 | Subject: [PATCH] V4L: Int if: Dummy slave | ||
5 | |||
6 | This patch implements a dummy slave that has no functionality. Helps | ||
7 | managing slaves in the OMAP 3 camera driver; no need to check for NULL | ||
8 | pointers. | ||
9 | |||
10 | Signed-off-by: Sakari Ailus <sakari.ailus@nokia.com> | ||
11 | --- | ||
12 | drivers/media/video/v4l2-int-device.c | 19 +++++++++++++++++++ | ||
13 | include/media/v4l2-int-device.h | 2 ++ | ||
14 | 2 files changed, 21 insertions(+), 0 deletions(-) | ||
15 | |||
16 | diff --git a/drivers/media/video/v4l2-int-device.c b/drivers/media/video/v4l2-int-device.c | ||
17 | index eb8dc84..483ee2e 100644 | ||
18 | --- a/drivers/media/video/v4l2-int-device.c | ||
19 | +++ b/drivers/media/video/v4l2-int-device.c | ||
20 | @@ -67,6 +67,25 @@ static void __v4l2_int_device_try_attach_all(void) | ||
21 | } | ||
22 | } | ||
23 | |||
24 | +static struct v4l2_int_slave dummy_slave = { | ||
25 | + /* Dummy pointer to avoid underflow in find_ioctl. */ | ||
26 | + .ioctls = (void *)sizeof(struct v4l2_int_ioctl_desc), | ||
27 | + .num_ioctls = 0, | ||
28 | +}; | ||
29 | + | ||
30 | +static struct v4l2_int_device dummy = { | ||
31 | + .type = v4l2_int_type_slave, | ||
32 | + .u = { | ||
33 | + .slave = &dummy_slave, | ||
34 | + }, | ||
35 | +}; | ||
36 | + | ||
37 | +struct v4l2_int_device *v4l2_int_device_dummy() | ||
38 | +{ | ||
39 | + return &dummy; | ||
40 | +} | ||
41 | +EXPORT_SYMBOL_GPL(v4l2_int_device_dummy); | ||
42 | + | ||
43 | void v4l2_int_device_try_attach_all(void) | ||
44 | { | ||
45 | mutex_lock(&mutex); | ||
46 | diff --git a/include/media/v4l2-int-device.h b/include/media/v4l2-int-device.h | ||
47 | index fbf5855..5d254c4 100644 | ||
48 | --- a/include/media/v4l2-int-device.h | ||
49 | +++ b/include/media/v4l2-int-device.h | ||
50 | @@ -84,6 +84,8 @@ struct v4l2_int_device { | ||
51 | void *priv; | ||
52 | }; | ||
53 | |||
54 | +struct v4l2_int_device *v4l2_int_device_dummy(void); | ||
55 | + | ||
56 | void v4l2_int_device_try_attach_all(void); | ||
57 | |||
58 | int v4l2_int_device_register(struct v4l2_int_device *d); | ||
59 | -- | ||
60 | 1.5.6.5 | ||
61 | |||