HomeFreeBSD

bus: Cleanup device_probe_child()

Description

bus: Cleanup device_probe_child()

When device driver probe method returns 0, i.e. absolute priority, do
not remove its class from the device just to set it back few lines
later, that may change the device unit number, etc. and after which
we'd better call the probe again.

If during search we found some driver with absolute priority, we do
not need to set device driver and class since we haven't removed them
before.

It should not happen, but if second probe method call failed, remove
the driver and possibly the class from the device as it was when we
started.

Reviewed by: imp, jhb
Differential Revision: https://reviews.freebsd.org/D32125

(cherry picked from commit f73c2bbf811ba77b2fe91b5bc0cbe19e9f7eb6c4)

Details

Provenance
mavAuthored on Sep 25 2021, 12:27 AM
Reviewer
imp
Differential Revision
D32125: bus: Cleanup device_probe_child()
Parents
rGdd39806d1dbe: bus: Fix LINT / BUS_DEBUG build
Branches
Unknown
Tags
Unknown