summaryrefslogtreecommitdiffstats
path: root/sys/kern/subr_bus.c
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2008-03-09 05:10:22 +0000
committerimp <imp@FreeBSD.org>2008-03-09 05:10:22 +0000
commita7ddb800e86928008fac21739e2f1c86a0381c13 (patch)
treea9764f861e9c47eae30d54b783ad0451b200ade2 /sys/kern/subr_bus.c
parent5fa24e49b2d17d7f05b980bccbc87bac2b528403 (diff)
downloadFreeBSD-src-a7ddb800e86928008fac21739e2f1c86a0381c13.zip
FreeBSD-src-a7ddb800e86928008fac21739e2f1c86a0381c13.tar.gz
Any driver that relies on its parent to set the devclass has no way to
know if has siblings that need an actual probe. Introduce a specail return value called BUS_PROBE_NOOWILDCARD. If the driver returns this, the probe is only successful for devices that have had a specific devclass set for them. Reviewed by: current@, jhb@, grehan@
Diffstat (limited to 'sys/kern/subr_bus.c')
-rw-r--r--sys/kern/subr_bus.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/sys/kern/subr_bus.c b/sys/kern/subr_bus.c
index 71924cc..9c07bf1 100644
--- a/sys/kern/subr_bus.c
+++ b/sys/kern/subr_bus.c
@@ -1777,6 +1777,14 @@ device_probe_child(device_t dev, device_t child)
* of pri for the first match.
*/
if (best == NULL || result > pri) {
+ /*
+ * Probes that return BUS_PROBE_NOWILDCARD
+ * or lower only match when they are set
+ * in stone by the parent bus.
+ */
+ if (result <= BUS_PROBE_NOWILDCARD &&
+ child->flags & DF_WILDCARD)
+ continue;
best = dl;
pri = result;
continue;
OpenPOWER on IntegriCloud