public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] videodev_init() -> initcall
@ 2001-05-18 20:57 Alexander Viro
  2001-05-19  0:07 ` Randy.Dunlap
  0 siblings, 1 reply; 2+ messages in thread
From: Alexander Viro @ 2001-05-18 20:57 UTC (permalink / raw)
  To: Alan Cox; +Cc: Linus Torvalds, linux-kernel

	Alan, drivers/media/videodev.c is your code. See if you are OK
with the patch below - it switches the thing to use of module_init()
and removes the call of videodev_init() from chr_dev_init(). I.e. the
only ordering change is that videodev_init() is postponed until immediately
before the media/video/* drivers.
	Linus, if you are OK with that and Alan will ACK the thing - please,
consider applying it.
								Al


diff -urN S5-pre3/drivers/char/mem.c S5-pre3-videodev/drivers/char/mem.c
--- S5-pre3/drivers/char/mem.c	Wed May 16 16:26:36 2001
+++ S5-pre3-videodev/drivers/char/mem.c	Fri May 18 16:46:37 2001
@@ -29,9 +29,6 @@
 #ifdef CONFIG_I2C
 extern int i2c_init_all(void);
 #endif
-#ifdef CONFIG_VIDEO_DEV
-extern int videodev_init(void);
-#endif
 #ifdef CONFIG_FB
 extern void fbmem_init(void);
 #endif
@@ -647,9 +644,6 @@
 #endif
 #if defined(CONFIG_ADB)
 	adbdev_init();
-#endif
-#ifdef CONFIG_VIDEO_DEV
-	videodev_init();
 #endif
 	return 0;
 }
diff -urN S5-pre3/drivers/media/video/videodev.c S5-pre3-videodev/drivers/media/video/videodev.c
--- S5-pre3/drivers/media/video/videodev.c	Sun Apr  1 23:56:57 2001
+++ S5-pre3-videodev/drivers/media/video/videodev.c	Fri May 18 16:48:34 2001
@@ -546,7 +546,7 @@
  *	Initialise video for linux
  */
  
-int __init videodev_init(void)
+static int __init videodev_init(void)
 {
 	struct video_init *vfli = video_init_list;
 	
@@ -573,13 +573,7 @@
 	return 0;
 }
 
-#ifdef MODULE		
-int init_module(void)
-{
-	return videodev_init();
-}
-
-void cleanup_module(void)
+static void __exit videodev_exit(void)
 {
 #if defined(CONFIG_PROC_FS) && defined(CONFIG_VIDEO_PROC_FS)
 	videodev_proc_destroy ();
@@ -588,7 +582,8 @@
 	devfs_unregister_chrdev(VIDEO_MAJOR, "video_capture");
 }
 
-#endif
+module_init(videodev_init)
+module_exit(videodev_exit)
 
 EXPORT_SYMBOL(video_register_device);
 EXPORT_SYMBOL(video_unregister_device);


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2001-05-19  1:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-05-18 20:57 [PATCH] videodev_init() -> initcall Alexander Viro
2001-05-19  0:07 ` Randy.Dunlap

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox