lkml.org 
[lkml]   [2001]   [Sep]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectPATCH: linux-2.4.10-pre14/drivers/net/tlan.c ignored pci_module_init result
	linux-2.4.10-pre4/drivers/net/tlan.c incorrectly used
pci_module_init instead of pci_register_module. pci_module_init will
unregister the PCI driver if no matching hardware is found and the
driver is compiled as a module. However, the driver may still remain
loaded is there is an EISA tlan device present. If a PCI tlan device
were subsequently plugged in, then the module would not handle it
because the PCI driver is not registered, and the module would not
be reloaded, because the module is already loaded to handle the
EISA device.

What should happen, is that the PCI driver should remain
registered unless the module is going to be unloaded, which is
what this patch does.

--
Adam J. Richter __ ______________ 4880 Stevens Creek Blvd, Suite 104
adam@yggdrasil.com \ / San Jose, California 95129-1034
+1 408 261-6630 | g g d r a s i l United States of America
fax +1 408 261-6631 "Free Software For The Rest Of Us."
--- linux-2.4.10-pre14/drivers/net/tlan.c Mon Jul 2 14:03:04 2001
+++ linux/drivers/net/tlan.c Sat Sep 22 23:10:59 2001
@@ -452,7 +452,7 @@

/* Use new style PCI probing. Now the kernel will
do most of this for us */
- pci_module_init(&tlan_driver);
+ pci_register_driver(&tlan_driver);

TLAN_DBG(TLAN_DEBUG_PROBE, "Starting EISA Probe....\n");
TLan_EisaProbe();
@@ -462,6 +462,7 @@
tlan_have_pci, tlan_have_eisa);

if (TLanDevicesInstalled == 0) {
+ pci_unregister_driver(&tlan_driver);
kfree(TLanPadBuffer);
return -ENODEV;
}
@@ -643,8 +644,7 @@

static void __exit tlan_exit(void)
{
- if (tlan_have_pci)
- pci_unregister_driver(&tlan_driver);
+ pci_unregister_driver(&tlan_driver);

if (tlan_have_eisa)
TLan_Eisa_Cleanup();
\
 
 \ /
  Last update: 2005-03-22 13:17    [W:4.151 / U:0.104 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site