lkml.org 
[lkml]   [2002]   [Jan]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[patch] Define new section for bus driver init

Ok, here is the consolidated patch. It does:

- defines new section: .devsubsys.init which is a table of function
pointers to bus driver initialization routines.
- adds section to each architecture's linker scripts
- removes all static calls from init/main.c to bus drivers
- converts drivers with referenced routines to use
device_subsys_init() to define the init routines, which
either places init routine in new section or defines it
as module_init().

Some caveats:

- for a function to be an initcall_t, it must return an int. Some of the
init routines returned void, and will fail on compile. I punted on
these, but they need to fixed.

- parisc/kernel/head.S defines the section .initcall.init. Does it also
need to do .devsubsys.init?

- This patch has only been tested on an x86 with PCI and isapnp enabled,
but should work on most everything.

Also, the init routines can now be declared static.

If people could give it a try and let me know if it works for them. And,
if they want to be really nice and convert the driver init routines, I
will integrate the patches and push them upstream.

-pat

P.s. Pine screws up the patch. It's attached so it applies cleanly (until
I find a better solution).
diff -Nur linux-2.5.2.orig/arch/alpha/vmlinux.lds.in linux-2.5.2/arch/alpha/vmlinux.lds.in
--- linux-2.5.2.orig/arch/alpha/vmlinux.lds.in Thu Nov 22 10:54:10 2001
+++ linux-2.5.2/arch/alpha/vmlinux.lds.in Tue Jan 15 13:59:41 2002
@@ -41,7 +41,10 @@

. = ALIGN(8);
__initcall_start = .;
- .initcall.init : { *(.initcall.init) }
+ .initcall : {
+ *(.devsubsys.init)
+ *(.initcall.init)
+ }
__initcall_end = .;

. = ALIGN(2*8192); /* Align double page for init_task_union */
diff -Nur linux-2.5.2.orig/arch/arm/kernel/ecard.c linux-2.5.2/arch/arm/kernel/ecard.c
--- linux-2.5.2.orig/arch/arm/kernel/ecard.c Tue Jan 15 13:55:53 2002
+++ linux-2.5.2/arch/arm/kernel/ecard.c Tue Jan 15 13:59:41 2002
@@ -1097,6 +1097,8 @@
ecard_proc_init();
}

+device_subsys_init(ecard_init);
+
EXPORT_SYMBOL(ecard_startfind);
EXPORT_SYMBOL(ecard_find);
EXPORT_SYMBOL(ecard_readchunk);
diff -Nur linux-2.5.2.orig/arch/arm/vmlinux-armo.lds.in linux-2.5.2/arch/arm/vmlinux-armo.lds.in
--- linux-2.5.2.orig/arch/arm/vmlinux-armo.lds.in Tue Jan 15 13:55:42 2002
+++ linux-2.5.2/arch/arm/vmlinux-armo.lds.in Tue Jan 15 13:59:41 2002
@@ -27,6 +27,7 @@
*(.setup.init)
__setup_end = .;
__initcall_start = .;
+ *(.devsubsys.init)
*(.initcall.init)
__initcall_end = .;
. = ALIGN(32768);
diff -Nur linux-2.5.2.orig/arch/arm/vmlinux-armv.lds.in linux-2.5.2/arch/arm/vmlinux-armv.lds.in
--- linux-2.5.2.orig/arch/arm/vmlinux-armv.lds.in Tue Jan 15 13:55:42 2002
+++ linux-2.5.2/arch/arm/vmlinux-armv.lds.in Tue Jan 15 13:59:41 2002
@@ -26,6 +26,7 @@
*(.setup.init)
__setup_end = .;
__initcall_start = .;
+ *(.devsubsys.init)
*(.initcall.init)
__initcall_end = .;
. = ALIGN(4096);
diff -Nur linux-2.5.2.orig/arch/cris/cris.ld linux-2.5.2/arch/cris/cris.ld
--- linux-2.5.2.orig/arch/cris/cris.ld Mon Oct 8 11:43:54 2001
+++ linux-2.5.2/arch/cris/cris.ld Tue Jan 15 13:59:41 2002
@@ -61,9 +61,10 @@
__setup_start = .;
.setup.init : { *(.setup.init) }
__setup_end = .;
- .initcall.init : {
+ .initcall : {
__initcall_start = .;
- *(.initcall.init);
+ *(.devsubsys.init)
+ *(.initcall.init)
__initcall_end = .;

/* We fill to the next page, so we can discard all init
diff -Nur linux-2.5.2.orig/arch/i386/kernel/mca.c linux-2.5.2/arch/i386/kernel/mca.c
--- linux-2.5.2.orig/arch/i386/kernel/mca.c Thu Aug 24 12:52:32 2000
+++ linux-2.5.2/arch/i386/kernel/mca.c Tue Jan 15 13:59:41 2002
@@ -311,6 +311,8 @@
#endif
}

+device_subsys_init(mca_init);
+
/*--------------------------------------------------------------------*/

static void mca_handle_nmi_slot(int slot, int check_flag)
diff -Nur linux-2.5.2.orig/arch/i386/vmlinux.lds linux-2.5.2/arch/i386/vmlinux.lds
--- linux-2.5.2.orig/arch/i386/vmlinux.lds Mon Jul 2 14:40:14 2001
+++ linux-2.5.2/arch/i386/vmlinux.lds Tue Jan 15 13:59:41 2002
@@ -48,7 +48,10 @@
.setup.init : { *(.setup.init) }
__setup_end = .;
__initcall_start = .;
- .initcall.init : { *(.initcall.init) }
+ .initcall : {
+ *(.devsubsys.init)
+ *(.initcall.init)
+ }
__initcall_end = .;
. = ALIGN(4096);
__init_end = .;
diff -Nur linux-2.5.2.orig/arch/ia64/vmlinux.lds.S linux-2.5.2/arch/ia64/vmlinux.lds.S
--- linux-2.5.2.orig/arch/ia64/vmlinux.lds.S Tue Jul 31 10:30:09 2001
+++ linux-2.5.2/arch/ia64/vmlinux.lds.S Tue Jan 15 13:59:41 2002
@@ -104,8 +104,10 @@
{ *(.setup.init) }
__setup_end = .;
__initcall_start = .;
- .initcall.init : AT(ADDR(.initcall.init) - PAGE_OFFSET)
- { *(.initcall.init) }
+ .initcall : AT(ADDR(.devsubsys.init) - PAGE_OFFSET) {
+ *(.devsubsys.init)
+ *(.initcall.init)
+ }
__initcall_end = .;
. = ALIGN(PAGE_SIZE);
__init_end = .;
diff -Nur linux-2.5.2.orig/arch/m68k/vmlinux-sun3.lds linux-2.5.2/arch/m68k/vmlinux-sun3.lds
--- linux-2.5.2.orig/arch/m68k/vmlinux-sun3.lds Mon Jul 2 14:40:14 2001
+++ linux-2.5.2/arch/m68k/vmlinux-sun3.lds Tue Jan 15 13:59:41 2002
@@ -43,7 +43,10 @@
.setup.init : { *(.setup.init) }
__setup_end = .;
__initcall_start = .;
- .initcall.init : { *(.initcall.init) }
+ .initcall : {
+ *(.devsubsys.init)
+ *(.initcall.init)
+ }
__initcall_end = .;
. = ALIGN(8192);
__init_end = .;
diff -Nur linux-2.5.2.orig/arch/m68k/vmlinux.lds linux-2.5.2/arch/m68k/vmlinux.lds
--- linux-2.5.2.orig/arch/m68k/vmlinux.lds Mon Jul 2 14:40:14 2001
+++ linux-2.5.2/arch/m68k/vmlinux.lds Tue Jan 15 13:59:41 2002
@@ -47,7 +47,10 @@
.setup.init : { *(.setup.init) }
__setup_end = .;
__initcall_start = .;
- .initcall.init : { *(.initcall.init) }
+ .initcall : {
+ *(.devsubsys.init)
+ *(.initcall.init)
+ }
__initcall_end = .;
. = ALIGN(8192);
__init_end = .;
diff -Nur linux-2.5.2.orig/arch/mips/ld.script.in linux-2.5.2/arch/mips/ld.script.in
--- linux-2.5.2.orig/arch/mips/ld.script.in Mon Jul 2 13:56:40 2001
+++ linux-2.5.2/arch/mips/ld.script.in Tue Jan 15 13:59:41 2002
@@ -44,7 +44,10 @@
.setup.init : { *(.setup.init) }
__setup_end = .;
__initcall_start = .;
- .initcall.init : { *(.initcall.init) }
+ .initcall : {
+ *(.devsubsys.init)
+ *(.initcall.init)
+ }
__initcall_end = .;
. = ALIGN(4096); /* Align double page for init_task_union */
__init_end = .;
diff -Nur linux-2.5.2.orig/arch/mips64/ld.script.elf32.S linux-2.5.2/arch/mips64/ld.script.elf32.S
--- linux-2.5.2.orig/arch/mips64/ld.script.elf32.S Mon Jul 2 14:40:58 2001
+++ linux-2.5.2/arch/mips64/ld.script.elf32.S Tue Jan 15 13:59:41 2002
@@ -40,7 +40,10 @@
.setup.init : { *(.setup.init) }
__setup_end = .;
__initcall_start = .;
- .initcall.init : { *(.initcall.init) }
+ .initcall : {
+ *(.devsubsys.init)
+ *(.initcall.init)
+ }
__initcall_end = .;
. = ALIGN(4096); /* Align double page for init_task_union */
__init_end = .;
diff -Nur linux-2.5.2.orig/arch/mips64/ld.script.elf64 linux-2.5.2/arch/mips64/ld.script.elf64
--- linux-2.5.2.orig/arch/mips64/ld.script.elf64 Mon Jul 2 14:40:58 2001
+++ linux-2.5.2/arch/mips64/ld.script.elf64 Tue Jan 15 13:59:41 2002
@@ -49,7 +49,10 @@
.setup.init : { *(.setup.init) }
__setup_end = .;
__initcall_start = .;
- .initcall.init : { *(.initcall.init) }
+ .initcall : {
+ *(.devsubsys.init)
+ *(.initcall.init)
+ }
__initcall_end = .;
. = ALIGN(4096); /* Align double page for init_task_union */
__init_end = .;
diff -Nur linux-2.5.2.orig/arch/parisc/vmlinux.lds linux-2.5.2/arch/parisc/vmlinux.lds
--- linux-2.5.2.orig/arch/parisc/vmlinux.lds Mon Jul 2 14:40:58 2001
+++ linux-2.5.2/arch/parisc/vmlinux.lds Tue Jan 15 13:59:41 2002
@@ -51,7 +51,10 @@
.setup.init : { *(.setup.init) }
__setup_end = .;
__initcall_start = .;
- .initcall.init : { *(.initcall.init) }
+ .initcall : {
+ *(.devsubsys.init)
+ *(.initcall.init)
+ }
__initcall_end = .;
__init_end = .;

diff -Nur linux-2.5.2.orig/arch/ppc/kernel/setup.c linux-2.5.2/arch/ppc/kernel/setup.c
--- linux-2.5.2.orig/arch/ppc/kernel/setup.c Tue Jan 15 13:55:53 2002
+++ linux-2.5.2/arch/ppc/kernel/setup.c Tue Jan 15 13:59:41 2002
@@ -535,6 +535,8 @@
}
}

+device_subsys_init(ppc_init);
+
/* Warning, IO base is not yet inited */
void __init setup_arch(char **cmdline_p)
{
diff -Nur linux-2.5.2.orig/arch/ppc/vmlinux.lds linux-2.5.2/arch/ppc/vmlinux.lds
--- linux-2.5.2.orig/arch/ppc/vmlinux.lds Tue Aug 28 06:58:33 2001
+++ linux-2.5.2/arch/ppc/vmlinux.lds Tue Jan 15 13:59:41 2002
@@ -94,7 +94,10 @@
.setup.init : { *(.setup.init) }
__setup_end = .;
__initcall_start = .;
- .initcall.init : { *(.initcall.init) }
+ .initcall : {
+ *(.devsubsys.init)
+ *(.initcall.init)
+ }
__initcall_end = .;
. = ALIGN(4096);
__init_end = .;
diff -Nur linux-2.5.2.orig/arch/s390/vmlinux-shared.lds linux-2.5.2/arch/s390/vmlinux-shared.lds
--- linux-2.5.2.orig/arch/s390/vmlinux-shared.lds Sun Aug 12 10:38:48 2001
+++ linux-2.5.2/arch/s390/vmlinux-shared.lds Tue Jan 15 13:59:41 2002
@@ -55,7 +55,10 @@
.setup.init : { *(.setup.init) }
__setup_end = .;
__initcall_start = .;
- .initcall.init : { *(.initcall.init) }
+ .initcall : {
+ *(.devsubsys.init)
+ *(.initcall.init)
+ }
__initcall_end = .;
. = ALIGN(4096);
__init_end = .;
diff -Nur linux-2.5.2.orig/arch/s390/vmlinux.lds linux-2.5.2/arch/s390/vmlinux.lds
--- linux-2.5.2.orig/arch/s390/vmlinux.lds Mon Jul 2 14:40:58 2001
+++ linux-2.5.2/arch/s390/vmlinux.lds Tue Jan 15 13:59:41 2002
@@ -53,7 +53,10 @@
.setup.init : { *(.setup.init) }
__setup_end = .;
__initcall_start = .;
- .initcall.init : { *(.initcall.init) }
+ .initcall : {
+ *(.devsubsys.init)
+ *(.initcall.init)
+ }
__initcall_end = .;
. = ALIGN(4096);
__init_end = .;
diff -Nur linux-2.5.2.orig/arch/s390x/vmlinux-shared.lds linux-2.5.2/arch/s390x/vmlinux-shared.lds
--- linux-2.5.2.orig/arch/s390x/vmlinux-shared.lds Sun Aug 12 10:38:48 2001
+++ linux-2.5.2/arch/s390x/vmlinux-shared.lds Tue Jan 15 13:59:41 2002
@@ -55,7 +55,10 @@
.setup.init : { *(.setup.init) }
__setup_end = .;
__initcall_start = .;
- .initcall.init : { *(.initcall.init) }
+ .initcall : {
+ *(.devsubsys.init)
+ *(.initcall.init)
+ }
__initcall_end = .;
. = ALIGN(4096);
__init_end = .;
diff -Nur linux-2.5.2.orig/arch/s390x/vmlinux.lds linux-2.5.2/arch/s390x/vmlinux.lds
--- linux-2.5.2.orig/arch/s390x/vmlinux.lds Mon Jul 2 14:40:58 2001
+++ linux-2.5.2/arch/s390x/vmlinux.lds Tue Jan 15 13:59:41 2002
@@ -53,7 +53,10 @@
.setup.init : { *(.setup.init) }
__setup_end = .;
__initcall_start = .;
- .initcall.init : { *(.initcall.init) }
+ .initcall : {
+ *(.devsubsys.init)
+ *(.initcall.init)
+ }
__initcall_end = .;
. = ALIGN(4096);
__init_end = .;
diff -Nur linux-2.5.2.orig/arch/sh/vmlinux.lds.S linux-2.5.2/arch/sh/vmlinux.lds.S
--- linux-2.5.2.orig/arch/sh/vmlinux.lds.S Sat Sep 8 12:29:09 2001
+++ linux-2.5.2/arch/sh/vmlinux.lds.S Tue Jan 15 13:59:41 2002
@@ -63,7 +63,10 @@
.setup.init : { *(.setup.init) }
__setup_end = .;
__initcall_start = .;
- .initcall.init : { *(.initcall.init) }
+ .initcall : {
+ *(.devsubsys.init)
+ *(.initcall.init)
+ }
__initcall_end = .;
__machvec_start = .;
.machvec.init : { *(.machvec.init) }
diff -Nur linux-2.5.2.orig/arch/sparc/vmlinux.lds linux-2.5.2/arch/sparc/vmlinux.lds
--- linux-2.5.2.orig/arch/sparc/vmlinux.lds Mon Jul 2 14:40:58 2001
+++ linux-2.5.2/arch/sparc/vmlinux.lds Tue Jan 15 13:59:41 2002
@@ -45,7 +45,10 @@
.setup_init : { *(.setup.init) }
__setup_end = .;
__initcall_start = .;
- .initcall.init : { *(.initcall.init) }
+ .initcall : {
+ *(.devsubsys.init)
+ *(.initcall.init)
+ }
__initcall_end = .;
. = ALIGN(4096);
__init_end = .;
diff -Nur linux-2.5.2.orig/arch/sparc64/vmlinux.lds linux-2.5.2/arch/sparc64/vmlinux.lds
--- linux-2.5.2.orig/arch/sparc64/vmlinux.lds Fri Sep 7 11:01:20 2001
+++ linux-2.5.2/arch/sparc64/vmlinux.lds Tue Jan 15 13:59:41 2002
@@ -46,7 +46,10 @@
.setup_init : { *(.setup.init) }
__setup_end = .;
__initcall_start = .;
- .initcall.init : { *(.initcall.init) }
+ .initcall : {
+ *(.devsubsys.init)
+ *(.initcall.init)
+ }
__initcall_end = .;
. = ALIGN(8192);
__init_end = .;
diff -Nur linux-2.5.2.orig/drivers/dio/dio.c linux-2.5.2/drivers/dio/dio.c
--- linux-2.5.2.orig/drivers/dio/dio.c Fri Feb 9 11:30:23 2001
+++ linux-2.5.2/drivers/dio/dio.c Tue Jan 15 13:59:41 2002
@@ -208,6 +208,8 @@
}
}

+device_subsys_init(dio_init);
+
/* Bear in mind that this is called in the very early stages of initialisation
* in order to get the virtual address of the serial port for the console...
*/
diff -Nur linux-2.5.2.orig/drivers/nubus/nubus.c linux-2.5.2/drivers/nubus/nubus.c
--- linux-2.5.2.orig/drivers/nubus/nubus.c Wed Jun 27 17:10:55 2001
+++ linux-2.5.2/drivers/nubus/nubus.c Tue Jan 15 13:59:41 2002
@@ -1039,3 +1039,5 @@
nubus_proc_init();
#endif
}
+
+device_subsys_init(nubus_init);
diff -Nur linux-2.5.2.orig/drivers/pci/pci.c linux-2.5.2/drivers/pci/pci.c
--- linux-2.5.2.orig/drivers/pci/pci.c Tue Nov 20 21:53:29 2001
+++ linux-2.5.2/drivers/pci/pci.c Tue Jan 15 13:59:41 2002
@@ -1929,7 +1929,7 @@
}


-void __devinit pci_init(void)
+static int __devinit pci_init(void)
{
struct pci_dev *dev;

@@ -1942,6 +1942,7 @@
#ifdef CONFIG_PM
pm_register(PM_PCI_DEV, 0, pci_pm_callback);
#endif
+ return 0;
}

static int __devinit pci_setup(char *str)
@@ -1958,6 +1959,8 @@
}
return 1;
}
+
+device_subsys_init(pci_init);

__setup("pci=", pci_setup);

diff -Nur linux-2.5.2.orig/drivers/pcmcia/ds.c linux-2.5.2/drivers/pcmcia/ds.c
--- linux-2.5.2.orig/drivers/pcmcia/ds.c Tue Jan 15 13:55:43 2002
+++ linux-2.5.2/drivers/pcmcia/ds.c Tue Jan 15 13:59:41 2002
@@ -966,12 +966,9 @@
return 0;
}

-#ifdef MODULE
+device_subsys_init(init_pcmcia_ds);

-int __init init_module(void)
-{
- return init_pcmcia_ds();
-}
+#ifdef MODULE

void __exit cleanup_module(void)
{
diff -Nur linux-2.5.2.orig/drivers/pnp/isapnp.c linux-2.5.2/drivers/pnp/isapnp.c
--- linux-2.5.2.orig/drivers/pnp/isapnp.c Mon Nov 12 10:02:54 2001
+++ linux-2.5.2/drivers/pnp/isapnp.c Tue Jan 15 13:59:41 2002
@@ -2356,12 +2356,9 @@
return 0;
}

-#ifdef MODULE
+device_subsys_init(isapnp_init);

-int init_module(void)
-{
- return isapnp_init();
-}
+#ifdef MODULE

void cleanup_module(void)
{
diff -Nur linux-2.5.2.orig/drivers/sbus/sbus.c linux-2.5.2/drivers/sbus/sbus.c
--- linux-2.5.2.orig/drivers/sbus/sbus.c Tue Jan 15 13:55:43 2002
+++ linux-2.5.2/drivers/sbus/sbus.c Tue Jan 15 13:59:41 2002
@@ -509,3 +509,5 @@
}
#endif
}
+
+device_subsys_call(sbus_init);
diff -Nur linux-2.5.2.orig/drivers/tc/tc.c linux-2.5.2/drivers/tc/tc.c
--- linux-2.5.2.orig/drivers/tc/tc.c Thu Oct 11 09:43:30 2001
+++ linux-2.5.2/drivers/tc/tc.c Tue Jan 15 13:59:41 2002
@@ -236,6 +236,8 @@
}
}

+device_subsys_init(tc_init);
+
EXPORT_SYMBOL(search_tc_card);
EXPORT_SYMBOL(claim_tc_card);
EXPORT_SYMBOL(release_tc_card);
diff -Nur linux-2.5.2.orig/drivers/zorro/zorro.c linux-2.5.2/drivers/zorro/zorro.c
--- linux-2.5.2.orig/drivers/zorro/zorro.c Fri Sep 7 09:28:38 2001
+++ linux-2.5.2/drivers/zorro/zorro.c Tue Jan 15 13:59:41 2002
@@ -170,6 +170,7 @@
m68k_memory[i].addr+m68k_memory[i].size, 0);
}

+device_subsys_init(zorro_init);

EXPORT_SYMBOL(zorro_find_device);
EXPORT_SYMBOL(zorro_unused_z2ram);
diff -Nur linux-2.5.2.orig/include/linux/init.h linux-2.5.2/include/linux/init.h
--- linux-2.5.2.orig/include/linux/init.h Thu Nov 22 11:46:18 2001
+++ linux-2.5.2/include/linux/init.h Tue Jan 15 13:59:41 2002
@@ -55,6 +55,13 @@
#define __exitcall(fn) \
static exitcall_t __exitcall_##fn __exit_call = fn

+#ifdef MODULE
+#define device_subsys_init(fn) \
+ module_init(fn);
+#else
+#define device_subsys_init(fn) \
+ static initcall_t __devsubsys_##fn __devsubsys_call = fn;
+#endif
/*
* Used for kernel command line parameter setup
*/
@@ -82,6 +89,7 @@
#define __initsetup __attribute__ ((unused,__section__ (".setup.init")))
#define __init_call __attribute__ ((unused,__section__ (".initcall.init")))
#define __exit_call __attribute__ ((unused,__section__ (".exitcall.exit")))
+#define __devsubsys_call __attribute__ ((unused,__section__ (".devsubsys.init")))

/* For assembly routines */
#define __INIT .section ".text.init","ax"
diff -Nur linux-2.5.2.orig/include/linux/pci.h linux-2.5.2/include/linux/pci.h
--- linux-2.5.2.orig/include/linux/pci.h Thu Nov 22 11:46:30 2001
+++ linux-2.5.2/include/linux/pci.h Tue Jan 15 13:59:41 2002
@@ -525,7 +525,6 @@

/* Generic PCI functions used internally */

-void pci_init(void);
int pci_bus_exists(const struct list_head *list, int nr);
struct pci_bus *pci_scan_bus(int bus, struct pci_ops *ops, void *sysdata);
struct pci_bus *pci_alloc_primary_bus(int bus);
diff -Nur linux-2.5.2.orig/init/main.c linux-2.5.2/init/main.c
--- linux-2.5.2.orig/init/main.c Tue Jan 15 13:55:44 2002
+++ linux-2.5.2/init/main.c Tue Jan 15 13:59:41 2002
@@ -38,35 +38,10 @@
#include <asm/ccwcache.h>
#endif

-#ifdef CONFIG_PCI
-#include <linux/pci.h>
-#endif
-
-#ifdef CONFIG_DIO
-#include <linux/dio.h>
-#endif
-
-#ifdef CONFIG_ZORRO
-#include <linux/zorro.h>
-#endif
-
#ifdef CONFIG_MTRR
# include <asm/mtrr.h>
#endif

-#ifdef CONFIG_NUBUS
-#include <linux/nubus.h>
-#endif
-
-#ifdef CONFIG_ISAPNP
-#include <linux/isapnp.h>
-#endif
-
-#ifdef CONFIG_IRDA
-extern int irda_proto_init(void);
-extern int irda_device_init(void);
-#endif
-
#ifdef CONFIG_X86_LOCAL_APIC
#include <asm/smp.h>
#endif
@@ -490,50 +465,11 @@
/* bring up the device tree */
device_driver_init();

-#ifdef CONFIG_PCI
- pci_init();
-#endif
-#ifdef CONFIG_SBUS
- sbus_init();
-#endif
-#if defined(CONFIG_PPC)
- ppc_init();
-#endif
-#ifdef CONFIG_MCA
- mca_init();
-#endif
-#ifdef CONFIG_ARCH_ACORN
- ecard_init();
-#endif
-#ifdef CONFIG_ZORRO
- zorro_init();
-#endif
-#ifdef CONFIG_DIO
- dio_init();
-#endif
-#ifdef CONFIG_NUBUS
- nubus_init();
-#endif
-#ifdef CONFIG_ISAPNP
- isapnp_init();
-#endif
-#ifdef CONFIG_TC
- tc_init();
-#endif
-
/* Networking initialization needs a process context */
sock_init();

start_context_thread();
do_initcalls();
-
-#ifdef CONFIG_IRDA
- irda_proto_init();
- irda_device_init(); /* Must be done after protocol initialization */
-#endif
-#ifdef CONFIG_PCMCIA
- init_pcmcia_ds(); /* Do this last */
-#endif
}

extern void prepare_namespace(void);
diff -Nur linux-2.5.2.orig/net/irda/af_irda.c linux-2.5.2/net/irda/af_irda.c
--- linux-2.5.2.orig/net/irda/af_irda.c Tue Jan 15 13:55:32 2002
+++ linux-2.5.2/net/irda/af_irda.c Tue Jan 15 13:59:41 2002
@@ -2590,14 +2590,14 @@
register_netdevice_notifier(&irda_dev_notifier);

irda_init();
-#ifdef MODULE
- irda_device_init(); /* Called by init/main.c when non-modular */
-#endif
+
+ irda_device_init();
+
return 0;
}
-#ifdef MODULE
-module_init(irda_proto_init); /* If non-module, called from init/main.c */
-#endif
+
+
+device_subsys_init(irda_proto_init);

/*
* Function irda_proto_cleanup (void)
\
 
 \ /
  Last update: 2005-03-22 13:23    [W:0.050 / U:24.276 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site