From c626f1fe9a7d794d4a0806eafbc08a44ca060747 Mon Sep 17 00:00:00 2001 From: John Baldwin Date: Tue, 20 Dec 2005 21:12:26 +0000 Subject: [PATCH] Change the various AGP drivers that attach to the Host-PCI bridge device to attach to the hostb driver instead. This means that agp can now be loaded at runtime (in theory at least). Also, the drivers no longer have to explicity call device_verbose() to cancel out any earlier calls to device_quiet() by the hostb(4) driver (this shows a limitation in new-bus, drivers really shouldn't be doing device_quiet() until they know they are going to drive that device, i.e. in attach). --- sys/dev/agp/agp_ali.c | 3 +-- sys/dev/agp/agp_amd.c | 3 +-- sys/dev/agp/agp_amd64.c | 3 +-- sys/dev/agp/agp_ati.c | 3 +-- sys/dev/agp/agp_intel.c | 3 +-- sys/dev/agp/agp_nvidia.c | 3 +-- sys/dev/agp/agp_sis.c | 3 +-- sys/dev/agp/agp_via.c | 3 +-- sys/pci/agp_ali.c | 3 +-- sys/pci/agp_amd.c | 3 +-- sys/pci/agp_amd64.c | 3 +-- sys/pci/agp_ati.c | 3 +-- sys/pci/agp_intel.c | 3 +-- sys/pci/agp_nvidia.c | 3 +-- sys/pci/agp_sis.c | 3 +-- sys/pci/agp_via.c | 3 +-- 16 files changed, 16 insertions(+), 32 deletions(-) diff --git a/sys/dev/agp/agp_ali.c b/sys/dev/agp/agp_ali.c index f39476b09409..a619547ace3a 100644 --- a/sys/dev/agp/agp_ali.c +++ b/sys/dev/agp/agp_ali.c @@ -85,7 +85,6 @@ agp_ali_probe(device_t dev) return (ENXIO); desc = agp_ali_match(dev); if (desc) { - device_verbose(dev); device_set_desc(dev, desc); return BUS_PROBE_DEFAULT; } @@ -271,6 +270,6 @@ static driver_t agp_ali_driver = { static devclass_t agp_devclass; -DRIVER_MODULE(agp_ali, pci, agp_ali_driver, agp_devclass, 0, 0); +DRIVER_MODULE(agp_ali, hostb, agp_ali_driver, agp_devclass, 0, 0); MODULE_DEPEND(agp_ali, agp, 1, 1, 1); MODULE_DEPEND(agp_ali, pci, 1, 1, 1); diff --git a/sys/dev/agp/agp_amd.c b/sys/dev/agp/agp_amd.c index bb1d20e14d64..3c9159d4f13d 100644 --- a/sys/dev/agp/agp_amd.c +++ b/sys/dev/agp/agp_amd.c @@ -207,7 +207,6 @@ agp_amd_probe(device_t dev) return (ENXIO); desc = agp_amd_match(dev); if (desc) { - device_verbose(dev); device_set_desc(dev, desc); return BUS_PROBE_DEFAULT; } @@ -415,6 +414,6 @@ static driver_t agp_amd_driver = { static devclass_t agp_devclass; -DRIVER_MODULE(agp_amd, pci, agp_amd_driver, agp_devclass, 0, 0); +DRIVER_MODULE(agp_amd, hostb, agp_amd_driver, agp_devclass, 0, 0); MODULE_DEPEND(agp_amd, agp, 1, 1, 1); MODULE_DEPEND(agp_amd, pci, 1, 1, 1); diff --git a/sys/dev/agp/agp_amd64.c b/sys/dev/agp/agp_amd64.c index e0b47b6165af..c0f06e94e17c 100644 --- a/sys/dev/agp/agp_amd64.c +++ b/sys/dev/agp/agp_amd64.c @@ -155,7 +155,6 @@ agp_amd64_probe(device_t dev) if (resource_disabled("agp", device_get_unit(dev))) return ENXIO; if ((desc = agp_amd64_match(dev))) { - device_verbose(dev); device_set_desc(dev, desc); return BUS_PROBE_DEFAULT; } @@ -515,6 +514,6 @@ static driver_t agp_amd64_driver = { static devclass_t agp_devclass; -DRIVER_MODULE(agp_amd64, pci, agp_amd64_driver, agp_devclass, 0, 0); +DRIVER_MODULE(agp_amd64, hostb, agp_amd64_driver, agp_devclass, 0, 0); MODULE_DEPEND(agp_amd64, agp, 1, 1, 1); MODULE_DEPEND(agp_amd64, pci, 1, 1, 1); diff --git a/sys/dev/agp/agp_ati.c b/sys/dev/agp/agp_ati.c index 8eed871efcc4..280cbc70e27e 100644 --- a/sys/dev/agp/agp_ati.c +++ b/sys/dev/agp/agp_ati.c @@ -111,7 +111,6 @@ agp_ati_probe(device_t dev) desc = agp_ati_match(dev); if (desc) { - device_verbose(dev); device_set_desc(dev, desc); return 0; } @@ -381,6 +380,6 @@ static driver_t agp_ati_driver = { static devclass_t agp_devclass; -DRIVER_MODULE(agp_ati, pci, agp_ati_driver, agp_devclass, 0, 0); +DRIVER_MODULE(agp_ati, hostb, agp_ati_driver, agp_devclass, 0, 0); MODULE_DEPEND(agp_ati, agp, 1, 1, 1); MODULE_DEPEND(agp_ati, pci, 1, 1, 1); diff --git a/sys/dev/agp/agp_intel.c b/sys/dev/agp/agp_intel.c index 42b49dc1b722..221f49ee60c0 100644 --- a/sys/dev/agp/agp_intel.c +++ b/sys/dev/agp/agp_intel.c @@ -134,7 +134,6 @@ agp_intel_probe(device_t dev) return (ENXIO); desc = agp_intel_match(dev); if (desc) { - device_verbose(dev); device_set_desc(dev, desc); return BUS_PROBE_DEFAULT; } @@ -425,6 +424,6 @@ static driver_t agp_intel_driver = { static devclass_t agp_devclass; -DRIVER_MODULE(agp_intel, pci, agp_intel_driver, agp_devclass, 0, 0); +DRIVER_MODULE(agp_intel, hostb, agp_intel_driver, agp_devclass, 0, 0); MODULE_DEPEND(agp_intel, agp, 1, 1, 1); MODULE_DEPEND(agp_intel, pci, 1, 1, 1); diff --git a/sys/dev/agp/agp_nvidia.c b/sys/dev/agp/agp_nvidia.c index 5e26622c69a7..8e4f35ff7eb9 100644 --- a/sys/dev/agp/agp_nvidia.c +++ b/sys/dev/agp/agp_nvidia.c @@ -121,7 +121,6 @@ agp_nvidia_probe (device_t dev) return (ENXIO); desc = agp_nvidia_match(dev); if (desc) { - device_verbose(dev); device_set_desc(dev, desc); return (BUS_PROBE_DEFAULT); } @@ -460,6 +459,6 @@ static driver_t agp_nvidia_driver = { static devclass_t agp_devclass; -DRIVER_MODULE(agp_nvidia, pci, agp_nvidia_driver, agp_devclass, 0, 0); +DRIVER_MODULE(agp_nvidia, hostb, agp_nvidia_driver, agp_devclass, 0, 0); MODULE_DEPEND(agp_nvidia, agp, 1, 1, 1); MODULE_DEPEND(agp_nvidia, pci, 1, 1, 1); diff --git a/sys/dev/agp/agp_sis.c b/sys/dev/agp/agp_sis.c index 0f3b31a41da1..867cce3f9bb3 100644 --- a/sys/dev/agp/agp_sis.c +++ b/sys/dev/agp/agp_sis.c @@ -119,7 +119,6 @@ agp_sis_probe(device_t dev) return (ENXIO); desc = agp_sis_match(dev); if (desc) { - device_verbose(dev); device_set_desc(dev, desc); return BUS_PROBE_DEFAULT; } @@ -293,6 +292,6 @@ static driver_t agp_sis_driver = { static devclass_t agp_devclass; -DRIVER_MODULE(agp_sis, pci, agp_sis_driver, agp_devclass, 0, 0); +DRIVER_MODULE(agp_sis, hostb, agp_sis_driver, agp_devclass, 0, 0); MODULE_DEPEND(agp_sis, agp, 1, 1, 1); MODULE_DEPEND(agp_sis, pci, 1, 1, 1); diff --git a/sys/dev/agp/agp_via.c b/sys/dev/agp/agp_via.c index f2cd381f2734..8d69a5afbd1a 100644 --- a/sys/dev/agp/agp_via.c +++ b/sys/dev/agp/agp_via.c @@ -143,7 +143,6 @@ agp_via_probe(device_t dev) return (ENXIO); desc = agp_via_match(dev); if (desc) { - device_verbose(dev); device_set_desc(dev, desc); return BUS_PROBE_DEFAULT; } @@ -363,6 +362,6 @@ static driver_t agp_via_driver = { static devclass_t agp_devclass; -DRIVER_MODULE(agp_via, pci, agp_via_driver, agp_devclass, 0, 0); +DRIVER_MODULE(agp_via, hostb, agp_via_driver, agp_devclass, 0, 0); MODULE_DEPEND(agp_via, agp, 1, 1, 1); MODULE_DEPEND(agp_via, pci, 1, 1, 1); diff --git a/sys/pci/agp_ali.c b/sys/pci/agp_ali.c index f39476b09409..a619547ace3a 100644 --- a/sys/pci/agp_ali.c +++ b/sys/pci/agp_ali.c @@ -85,7 +85,6 @@ agp_ali_probe(device_t dev) return (ENXIO); desc = agp_ali_match(dev); if (desc) { - device_verbose(dev); device_set_desc(dev, desc); return BUS_PROBE_DEFAULT; } @@ -271,6 +270,6 @@ static driver_t agp_ali_driver = { static devclass_t agp_devclass; -DRIVER_MODULE(agp_ali, pci, agp_ali_driver, agp_devclass, 0, 0); +DRIVER_MODULE(agp_ali, hostb, agp_ali_driver, agp_devclass, 0, 0); MODULE_DEPEND(agp_ali, agp, 1, 1, 1); MODULE_DEPEND(agp_ali, pci, 1, 1, 1); diff --git a/sys/pci/agp_amd.c b/sys/pci/agp_amd.c index bb1d20e14d64..3c9159d4f13d 100644 --- a/sys/pci/agp_amd.c +++ b/sys/pci/agp_amd.c @@ -207,7 +207,6 @@ agp_amd_probe(device_t dev) return (ENXIO); desc = agp_amd_match(dev); if (desc) { - device_verbose(dev); device_set_desc(dev, desc); return BUS_PROBE_DEFAULT; } @@ -415,6 +414,6 @@ static driver_t agp_amd_driver = { static devclass_t agp_devclass; -DRIVER_MODULE(agp_amd, pci, agp_amd_driver, agp_devclass, 0, 0); +DRIVER_MODULE(agp_amd, hostb, agp_amd_driver, agp_devclass, 0, 0); MODULE_DEPEND(agp_amd, agp, 1, 1, 1); MODULE_DEPEND(agp_amd, pci, 1, 1, 1); diff --git a/sys/pci/agp_amd64.c b/sys/pci/agp_amd64.c index e0b47b6165af..c0f06e94e17c 100644 --- a/sys/pci/agp_amd64.c +++ b/sys/pci/agp_amd64.c @@ -155,7 +155,6 @@ agp_amd64_probe(device_t dev) if (resource_disabled("agp", device_get_unit(dev))) return ENXIO; if ((desc = agp_amd64_match(dev))) { - device_verbose(dev); device_set_desc(dev, desc); return BUS_PROBE_DEFAULT; } @@ -515,6 +514,6 @@ static driver_t agp_amd64_driver = { static devclass_t agp_devclass; -DRIVER_MODULE(agp_amd64, pci, agp_amd64_driver, agp_devclass, 0, 0); +DRIVER_MODULE(agp_amd64, hostb, agp_amd64_driver, agp_devclass, 0, 0); MODULE_DEPEND(agp_amd64, agp, 1, 1, 1); MODULE_DEPEND(agp_amd64, pci, 1, 1, 1); diff --git a/sys/pci/agp_ati.c b/sys/pci/agp_ati.c index 8eed871efcc4..280cbc70e27e 100644 --- a/sys/pci/agp_ati.c +++ b/sys/pci/agp_ati.c @@ -111,7 +111,6 @@ agp_ati_probe(device_t dev) desc = agp_ati_match(dev); if (desc) { - device_verbose(dev); device_set_desc(dev, desc); return 0; } @@ -381,6 +380,6 @@ static driver_t agp_ati_driver = { static devclass_t agp_devclass; -DRIVER_MODULE(agp_ati, pci, agp_ati_driver, agp_devclass, 0, 0); +DRIVER_MODULE(agp_ati, hostb, agp_ati_driver, agp_devclass, 0, 0); MODULE_DEPEND(agp_ati, agp, 1, 1, 1); MODULE_DEPEND(agp_ati, pci, 1, 1, 1); diff --git a/sys/pci/agp_intel.c b/sys/pci/agp_intel.c index 42b49dc1b722..221f49ee60c0 100644 --- a/sys/pci/agp_intel.c +++ b/sys/pci/agp_intel.c @@ -134,7 +134,6 @@ agp_intel_probe(device_t dev) return (ENXIO); desc = agp_intel_match(dev); if (desc) { - device_verbose(dev); device_set_desc(dev, desc); return BUS_PROBE_DEFAULT; } @@ -425,6 +424,6 @@ static driver_t agp_intel_driver = { static devclass_t agp_devclass; -DRIVER_MODULE(agp_intel, pci, agp_intel_driver, agp_devclass, 0, 0); +DRIVER_MODULE(agp_intel, hostb, agp_intel_driver, agp_devclass, 0, 0); MODULE_DEPEND(agp_intel, agp, 1, 1, 1); MODULE_DEPEND(agp_intel, pci, 1, 1, 1); diff --git a/sys/pci/agp_nvidia.c b/sys/pci/agp_nvidia.c index 5e26622c69a7..8e4f35ff7eb9 100644 --- a/sys/pci/agp_nvidia.c +++ b/sys/pci/agp_nvidia.c @@ -121,7 +121,6 @@ agp_nvidia_probe (device_t dev) return (ENXIO); desc = agp_nvidia_match(dev); if (desc) { - device_verbose(dev); device_set_desc(dev, desc); return (BUS_PROBE_DEFAULT); } @@ -460,6 +459,6 @@ static driver_t agp_nvidia_driver = { static devclass_t agp_devclass; -DRIVER_MODULE(agp_nvidia, pci, agp_nvidia_driver, agp_devclass, 0, 0); +DRIVER_MODULE(agp_nvidia, hostb, agp_nvidia_driver, agp_devclass, 0, 0); MODULE_DEPEND(agp_nvidia, agp, 1, 1, 1); MODULE_DEPEND(agp_nvidia, pci, 1, 1, 1); diff --git a/sys/pci/agp_sis.c b/sys/pci/agp_sis.c index 0f3b31a41da1..867cce3f9bb3 100644 --- a/sys/pci/agp_sis.c +++ b/sys/pci/agp_sis.c @@ -119,7 +119,6 @@ agp_sis_probe(device_t dev) return (ENXIO); desc = agp_sis_match(dev); if (desc) { - device_verbose(dev); device_set_desc(dev, desc); return BUS_PROBE_DEFAULT; } @@ -293,6 +292,6 @@ static driver_t agp_sis_driver = { static devclass_t agp_devclass; -DRIVER_MODULE(agp_sis, pci, agp_sis_driver, agp_devclass, 0, 0); +DRIVER_MODULE(agp_sis, hostb, agp_sis_driver, agp_devclass, 0, 0); MODULE_DEPEND(agp_sis, agp, 1, 1, 1); MODULE_DEPEND(agp_sis, pci, 1, 1, 1); diff --git a/sys/pci/agp_via.c b/sys/pci/agp_via.c index f2cd381f2734..8d69a5afbd1a 100644 --- a/sys/pci/agp_via.c +++ b/sys/pci/agp_via.c @@ -143,7 +143,6 @@ agp_via_probe(device_t dev) return (ENXIO); desc = agp_via_match(dev); if (desc) { - device_verbose(dev); device_set_desc(dev, desc); return BUS_PROBE_DEFAULT; } @@ -363,6 +362,6 @@ static driver_t agp_via_driver = { static devclass_t agp_devclass; -DRIVER_MODULE(agp_via, pci, agp_via_driver, agp_devclass, 0, 0); +DRIVER_MODULE(agp_via, hostb, agp_via_driver, agp_devclass, 0, 0); MODULE_DEPEND(agp_via, agp, 1, 1, 1); MODULE_DEPEND(agp_via, pci, 1, 1, 1);