login
Header Space

 
 

Re: [patch] video: fix build bugs in drivers/media/video/stk-webcam.c

Score:
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Jaime Velasco <jsagarribay@...>
Cc: Ingo Molnar <mingo@...>, <linux-kernel@...>
Date: Wednesday, May 7, 2008 - 3:29 pm

On Wed, 30 Apr 2008 08:11:08 +0100
"Jaime Velasco" <jsagarribay@gmail.com> wrote:


The V4L1 symbols are used to help us to track what drivers are still using the
depreciated V4L1 API, or otherwise provide support for V4L1 compatibility
layer. This is not the case of stkwebcam.

So, instead of the proposed patch, I prefer just to disable the additional
non-V4L2 sysfs interface, if the flag is not enabled.

There are some discussions at the ML to create a standard to allow configuring
V4L2 controls via sysfs, but this is not standard yet. The idea is to add some
support at videodev.h using the same handlers defined by video_ioctl2.
Unfortunately, people stopped discussing this, due to the lack of time and
people to work on this.

I think this could be a nice addition to V4L2, and will help to avoid creating
non-standardized interfaces at sysfs.


I probably missed this.

---

Instead of Ingo's approach, this seems to be cleaner:

Fix compilation, when V4L1_COMPAT is disabled

From: Mauro Carvalho Chehab <mchehab@infradead.org>

This driver uses some sysfs helper functions that are available only for legacy
drivers. It also requires linux/mm.h.

This patch fixes compiliation when not in compat mode.

Thanks to Ingo Molnar for identifying this issue.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
---

 drivers/media/video/stk-webcam.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)


diff --git a/drivers/media/video/stk-webcam.c b/drivers/media/video/stk-webcam.c
index 9276ed9..b12c60c 100644
--- a/drivers/media/video/stk-webcam.c
+++ b/drivers/media/video/stk-webcam.c
@@ -30,6 +30,7 @@
 #include <linux/kref.h>
 
 #include <linux/usb.h>
+#include <linux/mm.h>
 #include <linux/vmalloc.h>
 #include <linux/videodev2.h>
 #include <media/v4l2-common.h>
@@ -245,6 +246,8 @@ static int stk_initialise(struct stk_camera *dev)
 		return -1;
 }
 
+#ifdef CONFIG_VIDEO_V4L1_COMPAT
+
 /* sysfs functions */
 /*FIXME cleanup this */
 
@@ -350,6 +353,10 @@ static void stk_remove_sysfs_files(struct video_device *vdev)
 	video_device_remove_file(vdev, &dev_attr_vflip);
 }
 
+#else
+#define stk_create_sysfs_files(a)
+#define stk_remove_sysfs_files(a)
+#endif
 
 /* *********************************************** */
 /*





Cheers,
Mauro
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [patch] video: fix build bugs in drivers/media/video/stk..., Mauro Carvalho Chehab, (Wed May 7, 3:29 pm)
Re: [patch] video: fix build bugs in drivers/media/video/stk..., Jaime Velasco Juan, (Fri May 9, 1:10 pm)
speck-geostationary