Allow drivers to return BUS_PROBE_NOWILDCARD from their attach routine to

match devices where the driver class was fixed but the unit number was
wildcarded.  This better matches the documented behaviour in
DEVICE_PROBE(9).

Reviewed by:	imp
This commit is contained in:
Ryan Stone 2013-08-08 19:30:49 +00:00
parent b74dd6c77b
commit 08a42caa50

View File

@ -2077,11 +2077,11 @@ device_probe_child(device_t dev, device_t child)
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.
* or lower only match on devices whose
* driver was explicitly specified.
*/
if (result <= BUS_PROBE_NOWILDCARD &&
child->flags & DF_WILDCARD)
!(child->flags & DF_FIXEDCLASS))
continue;
best = dl;
pri = result;