Re: [PATCH] network driver updates

From: Manfred Spraul (manfred@colorfullife.com)
Date: Wed Feb 14 2001 - 12:56:06 EST


David Hinds wrote:
>
> Say the driver is linked into the kernel. Hot plug drivers should not
> all complain about not finding their hardware.
>

That's handled by pci_module_init(), check <linux/pci.h>:
if CONFIG_HOTPLUG is enabled, then pci_module_init() never returns with
-ENODEV.

Which means that eisa cards will never be probed in a hotplug enabled
kernel.

And loading the current 3c59x.c into a non CONFIG_HOTPLUG non EISA
kernel results in a disconnected driver:
it's _not_ registered as a pci driver, pci_module_init() calls
pci_unregister_driver().

What about the attached patch?

--- 2.4/drivers/net/3c59x.c Wed Feb 14 10:50:50 2001
+++ build-2.4/drivers/net/3c59x.c Wed Feb 14 18:51:55 2001
@@ -2661,13 +2661,16 @@
         
         rc = pci_module_init(&vortex_driver);
         if (rc < 0) {
- rc = vortex_eisa_init();
- if (rc > 0)
- vortex_have_eisa = 1;
+ if (rc != -ENODEV)
+ return rc;
         } else {
                 vortex_have_pci = 1;
         }
 
+ if (vortex_eisa_init() > 0) {
+ vortex_have_eisa = 1;
+ rc = 0;
+ }
         return rc;
 }
 

-
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/



This archive was generated by hypermail 2b29 : Thu Feb 15 2001 - 21:00:25 EST