summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Stezenbach <devnull@localhost>2005-02-16 20:24:37 +0000
committerJohannes Stezenbach <devnull@localhost>2005-02-16 20:24:37 +0000
commitd57395c9d242f9e9aff04a7231575f24dc4e43f9 (patch)
tree0026d059b79cac3c9d6b1c40a49d05adf2c530fa
parente62932b3e741f8f9a2f4891d59a4ee69ddea6e2c (diff)
downloadmediapointer-dvb-s2-d57395c9d242f9e9aff04a7231575f24dc4e43f9.tar.gz
mediapointer-dvb-s2-d57395c9d242f9e9aff04a7231575f24dc4e43f9.tar.bz2
Static initialization.
Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
-rw-r--r--linux/drivers/media/common/saa7146_core.c29
1 files changed, 2 insertions, 27 deletions
diff --git a/linux/drivers/media/common/saa7146_core.c b/linux/drivers/media/common/saa7146_core.c
index 9acb1bf40..76cdc5481 100644
--- a/linux/drivers/media/common/saa7146_core.c
+++ b/linux/drivers/media/common/saa7146_core.c
@@ -20,11 +20,9 @@
#include <media/saa7146.h>
-/* global variables */
-struct list_head saa7146_devices;
-struct semaphore saa7146_devices_lock;
+LIST_HEAD(saa7146_devices);
+DECLARE_MUTEX(saa7146_devices_lock);
-static int initialized = 0;
static int saa7146_num = 0;
unsigned int saa7146_debug = 0;
@@ -527,12 +525,6 @@ int saa7146_register_extension(struct saa7146_extension* ext)
{
DEB_EE(("ext:%p\n",ext));
- if( 0 == initialized ) {
- INIT_LIST_HEAD(&saa7146_devices);
- init_MUTEX(&saa7146_devices_lock);
- initialized = 1;
- }
-
ext->driver.name = ext->name;
ext->driver.id_table = ext->pci_tbl;
ext->driver.probe = saa7146_init_one;
@@ -550,23 +542,6 @@ int saa7146_unregister_extension(struct saa7146_extension* ext)
return 0;
}
-static int __init saa7146_init_module(void)
-{
- if( 0 == initialized ) {
- INIT_LIST_HEAD(&saa7146_devices);
- init_MUTEX(&saa7146_devices_lock);
- initialized = 1;
- }
- return 0;
-}
-
-static void __exit saa7146_cleanup_module(void)
-{
-}
-
-module_init(saa7146_init_module);
-module_exit(saa7146_cleanup_module);
-
EXPORT_SYMBOL_GPL(saa7146_register_extension);
EXPORT_SYMBOL_GPL(saa7146_unregister_extension);