That's what we want to happen, isn't it? If it's not a hotplug
kernel and the hardware isn't there at boot time, don't register
the PCI driver. But still scan for EISA devices. That's what
the patch I sent yesterday does. Here it is:
static int __init vortex_init (void)
{
int pci_rc, eisa_rc;
pci_rc = pci_module_init(&vortex_driver);
eisa_rc = vortex_eisa_init();
if (pci_rc == 0)
vortex_have_pci = 1;
if (eisa_rc > 0)
vortex_have_eisa = 1;
return (vortex_have_pci + vortex_have_eisa) ? 0 : -ENODEV;
}
Really, vortex_have_pci should be called
vortex_have_pci_or_hotplug_and_dont_have_pci.
Look. When the driver's init_module() method is called
there are four combinations which must be catered for
(ignoring EISA):
CONFIG_HOTPLUG=n, MODULE=false
If the hardware isn't there, don't register
the pci_driver. It can't _do_ anything.
CONFIG_HOTPLUG=n, MODULE=true
If the hardware isn't there, barf. modprobe will
remove the driver again.
CONFIG_HOTPLUG=y, MODULE=false
If the hardware isn't there, register the pci
driver, because the hardware may appear later
CONFIG_HOTPLUG=y, MODULE=true
If the hardware isn't there, barf. modprobe will remove
the driver. Later, when the hardware is inserted, another
modprobe will succeed.
This is what yesterday's patch implements.
Now, the thing I don't understand about David's design is the
final one. What 3c575_cb does is:
CONFIG_HOTPLUG=y, MODULE=true
If the hardware isn't there, register the driver and
hang around.
Why?
BTW: How come CONFIG_PCMCIA requires CONFIG_HOTPLUG? Doesn't
it make sense to be able to have glued-in Cardbus devices?
-
-
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/