Changeset View
Changeset View
Standalone View
Standalone View
head/sys/kern/subr_bus.c
Show First 20 Lines • Show All 2,107 Lines • ▼ Show 20 Lines | for (dl = first_matching_driver(dc, child); | ||||
*/ | */ | ||||
if (result == 0) { | if (result == 0) { | ||||
best = dl; | best = dl; | ||||
pri = 0; | pri = 0; | ||||
break; | break; | ||||
} | } | ||||
/* | /* | ||||
* Probes that return BUS_PROBE_NOWILDCARD or lower | |||||
* only match on devices whose driver was explicitly | |||||
* specified. | |||||
*/ | |||||
if (result <= BUS_PROBE_NOWILDCARD && | |||||
!(child->flags & DF_FIXEDCLASS)) { | |||||
result = ENXIO; | |||||
} | |||||
/* | |||||
* The driver returned an error so it | * The driver returned an error so it | ||||
* certainly doesn't match. | * certainly doesn't match. | ||||
*/ | */ | ||||
if (result > 0) { | if (result > 0) { | ||||
(void)device_set_driver(child, NULL); | (void)device_set_driver(child, NULL); | ||||
continue; | continue; | ||||
} | } | ||||
/* | /* | ||||
* A priority lower than SUCCESS, remember the | * A priority lower than SUCCESS, remember the | ||||
* best matching driver. Initialise the value | * best matching driver. Initialise the value | ||||
* of pri for the first match. | * of pri for the first match. | ||||
*/ | */ | ||||
if (best == NULL || result > pri) { | if (best == NULL || result > pri) { | ||||
/* | |||||
* Probes that return BUS_PROBE_NOWILDCARD | |||||
* or lower only match on devices whose | |||||
* driver was explicitly specified. | |||||
*/ | |||||
if (result <= BUS_PROBE_NOWILDCARD && | |||||
!(child->flags & DF_FIXEDCLASS)) | |||||
continue; | |||||
best = dl; | best = dl; | ||||
pri = result; | pri = result; | ||||
continue; | continue; | ||||
} | } | ||||
} | } | ||||
/* | /* | ||||
* If we have an unambiguous match in this devclass, | * If we have an unambiguous match in this devclass, | ||||
* don't look in the parent. | * don't look in the parent. | ||||
▲ Show 20 Lines • Show All 3,161 Lines • Show Last 20 Lines |