diff options
| author | John Baldwin <jhb@FreeBSD.org> | 2006-01-20 21:59:13 +0000 |
|---|---|---|
| committer | John Baldwin <jhb@FreeBSD.org> | 2006-01-20 21:59:13 +0000 |
| commit | 267ec43593e9197b42f841ebb466538079bd06b8 (patch) | |
| tree | eec17a9b197066f7f038be2d63c8c1ea557d7d1d /sys | |
| parent | fe2f3fab4ad410770834bfea3000e2183b0ccd90 (diff) | |
Notes
Diffstat (limited to 'sys')
| -rw-r--r-- | sys/kern/subr_bus.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/sys/kern/subr_bus.c b/sys/kern/subr_bus.c index 7f7bb9343746d..b19be5417f377 100644 --- a/sys/kern/subr_bus.c +++ b/sys/kern/subr_bus.c @@ -781,7 +781,17 @@ devclass_find_internal(const char *classname, const char *parentname, bus_data_generation_update(); } - if (parentname && dc && !dc->parent) { + + /* + * If a parent class is specified, then set that as our parent so + * that this devclass will support drivers for the parent class as + * well. If the parent class has the same name don't do this though + * as it creates a cycle that can trigger an infinite loop in + * device_probe_child() if a device exists for which there is no + * suitable driver. + */ + if (parentname && dc && !dc->parent && + strcmp(classname, parentname) != 0) { dc->parent = devclass_find_internal(parentname, 0, FALSE); } |
