From: "Randy.Dunlap" <randy.dunlap@intel.com>
To: Alexander Viro <viro@math.psu.edu>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>,
Linus Torvalds <torvalds@transmeta.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] videodev_init() -> initcall
Date: Fri, 18 May 2001 17:07:28 -0700 [thread overview]
Message-ID: <3B05B940.E74F4E62@intel.com> (raw)
In-Reply-To: <Pine.GSO.4.21.0105181651220.1896-100000@weyl.math.psu.edu>
[-- Attachment #1: Type: text/plain, Size: 2453 bytes --]
Al's patch gives me:
videodev.c:550: warning: static declaration for `videodev_init' follows
non-static
videodev.c: In function `videodev_exit':
videodev.c:579: warning: implicit declaration of function
`videodev_proc_destroy'
Patch to use after Al's patch is attached.
~Randy
Alexander Viro wrote:
>
> 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);
>
> -
[-- Attachment #2: viddev2.patch --]
[-- Type: text/plain, Size: 691 bytes --]
--- linux/include/linux/videodev.h.org Fri May 18 15:56:32 2001
+++ linux/include/linux/videodev.h Fri May 18 16:45:03 2001
@@ -33,7 +33,6 @@
devfs_handle_t devfs_handle;
};
-extern int videodev_init(void);
#define VIDEO_MAJOR 81
extern int video_register_device(struct video_device *, int type);
--- linux/drivers/media/video/videodev.c.org Fri May 18 16:18:45 2001
+++ linux/drivers/media/video/videodev.c Fri May 18 16:37:44 2001
@@ -575,8 +575,10 @@
static void __exit videodev_exit(void)
{
+#ifdef MODULE
#if defined(CONFIG_PROC_FS) && defined(CONFIG_VIDEO_PROC_FS)
videodev_proc_destroy ();
+#endif
#endif
devfs_unregister_chrdev(VIDEO_MAJOR, "video_capture");
prev parent reply other threads:[~2001-05-19 1:07 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-05-18 20:57 [PATCH] videodev_init() -> initcall Alexander Viro
2001-05-19 0:07 ` Randy.Dunlap [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3B05B940.E74F4E62@intel.com \
--to=randy.dunlap@intel.com \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@transmeta.com \
--cc=viro@math.psu.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox