2002-06-11 21:32:13

by Tom Rini

[permalink] [raw]
Subject: [PATCH] Fix CONFIG_VIDEO_DEV=y

Currently 2.4.19-pre10 and 2.5.21 won't compile if CONFIG_VIDEO_DEV=y.

The problem is that videodev_proc_destroy() is protected by MODULE &&
CONFIG_PROC_FS && CONFIG_VIDEO_PROC_FS. Additionally, all calls to
videodev_proc_create() are protected by CONFIG_PROC_FS &&
CONFIG_VIDEO_PROC_FS but the function itself (which is static) is not.

This hides both functions within CONFIG_PROC_FS && CONFIG_VIDEO_PROC_FS
tests.

--
Tom Rini (TR1265)
http://gate.crashing.org/~trini/

===== drivers/media/video/videodev.c 1.10 vs edited =====
--- 1.10/drivers/media/video/videodev.c Thu May 2 08:48:22 2002
+++ edited/drivers/media/video/videodev.c Tue Jun 11 14:27:08 2002
@@ -394,6 +394,7 @@
return len;
}

+#if defined(CONFIG_PROC_FS) && defined(CONFIG_VIDEO_PROC_FS)
static void videodev_proc_create(void)
{
video_proc_entry = create_proc_entry("video", S_IFDIR, &proc_root);
@@ -414,8 +415,6 @@
video_dev_proc_entry->owner = THIS_MODULE;
}

-#ifdef MODULE
-#if defined(CONFIG_PROC_FS) && defined(CONFIG_VIDEO_PROC_FS)
static void videodev_proc_destroy(void)
{
if (video_dev_proc_entry != NULL)
@@ -424,7 +423,6 @@
if (video_proc_entry != NULL)
remove_proc_entry("video", &proc_root);
}
-#endif
#endif

static void videodev_proc_create_dev (struct video_device *vfd, char *name)