lkml.org 
[lkml]   [2005]   [Mar]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[DVB patch 25/48] saa7146: static initialization
Static initialization.

Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Signed-off-by: Johannes Stezenbach <js@linuxtv.org>

saa7146_core.c | 29 ++---------------------------
1 files changed, 2 insertions(+), 27 deletions(-)

Index: linux-2.6.12-rc1-mm1/drivers/media/common/saa7146_core.c
===================================================================
--- linux-2.6.12-rc1-mm1.orig/drivers/media/common/saa7146_core.c 2005-03-21 23:27:57.000000000 +0100
+++ linux-2.6.12-rc1-mm1/drivers/media/common/saa7146_core.c 2005-03-22 00:18:04.000000000 +0100
@@ -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 sa
{
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
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);

--

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:11    [W:0.129 / U:2.736 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site