ata: Remove ata_devclass from DRIVER_MODULE invocations.
Keep the global variable for its uses in ata-pci.c and chipsets/ata-fsl.c but initialize it in the existing ata_module_event_handler. Move the module event handler a bit earlier to ensure the variable is set before any devices are attached.
This commit is contained in:
parent
216ca4cee1
commit
d5a7306c75
@ -1214,6 +1214,7 @@ ata_module_event_handler(module_t mod, int what, void *arg)
|
||||
|
||||
switch (what) {
|
||||
case MOD_LOAD:
|
||||
ata_devclass = devclass_find("ata");
|
||||
return 0;
|
||||
|
||||
case MOD_UNLOAD:
|
||||
@ -1225,6 +1226,6 @@ ata_module_event_handler(module_t mod, int what, void *arg)
|
||||
}
|
||||
|
||||
static moduledata_t ata_moduledata = { "ata", ata_module_event_handler, NULL };
|
||||
DECLARE_MODULE(ata, ata_moduledata, SI_SUB_CONFIGURE, SI_ORDER_SECOND);
|
||||
DECLARE_MODULE(ata, ata_moduledata, SI_SUB_DRIVERS, SI_ORDER_ANY);
|
||||
MODULE_VERSION(ata, 1);
|
||||
MODULE_DEPEND(ata, cam, 1, 1, 1);
|
||||
|
@ -204,6 +204,6 @@ static driver_t ata_isa_driver = {
|
||||
sizeof(struct ata_channel),
|
||||
};
|
||||
|
||||
DRIVER_MODULE(ata, isa, ata_isa_driver, ata_devclass, NULL, NULL);
|
||||
DRIVER_MODULE(ata, isa, ata_isa_driver, NULL, NULL);
|
||||
MODULE_DEPEND(ata, ata, 1, 1, 1);
|
||||
ISA_PNP_INFO(ata_ids);
|
||||
|
@ -767,7 +767,7 @@ driver_t ata_pcichannel_driver = {
|
||||
sizeof(struct ata_channel),
|
||||
};
|
||||
|
||||
DRIVER_MODULE(ata, atapci, ata_pcichannel_driver, ata_devclass, NULL, NULL);
|
||||
DRIVER_MODULE(ata, atapci, ata_pcichannel_driver, NULL, NULL);
|
||||
|
||||
/*
|
||||
* misc support fucntions
|
||||
|
@ -121,7 +121,7 @@ static driver_t ata_kauai_driver = {
|
||||
sizeof(struct ata_kauai_softc),
|
||||
};
|
||||
|
||||
DRIVER_MODULE(ata, pci, ata_kauai_driver, ata_devclass, NULL, NULL);
|
||||
DRIVER_MODULE(ata, pci, ata_kauai_driver, NULL, NULL);
|
||||
MODULE_DEPEND(ata, ata, 1, 1, 1);
|
||||
|
||||
/*
|
||||
|
@ -149,7 +149,7 @@ static driver_t ata_macio_driver = {
|
||||
sizeof(struct ata_macio_softc),
|
||||
};
|
||||
|
||||
DRIVER_MODULE(ata, macio, ata_macio_driver, ata_devclass, NULL, NULL);
|
||||
DRIVER_MODULE(ata, macio, ata_macio_driver, NULL, NULL);
|
||||
MODULE_DEPEND(ata, ata, 1, 1, 1);
|
||||
|
||||
static int
|
||||
|
@ -230,7 +230,7 @@ static driver_t ata_iobus_sub_driver = {
|
||||
sizeof(struct ata_channel),
|
||||
};
|
||||
|
||||
DRIVER_MODULE(ata, ataiobus, ata_iobus_sub_driver, ata_devclass, NULL, NULL);
|
||||
DRIVER_MODULE(ata, ataiobus, ata_iobus_sub_driver, NULL, NULL);
|
||||
|
||||
static int
|
||||
ata_iobus_sub_probe(device_t dev)
|
||||
|
Loading…
Reference in New Issue
Block a user