HomeFreeBSD

uart: Go back to returning '0' when we've probed the device.

Description

uart: Go back to returning '0' when we've probed the device.

Two reasons for this: we know it's a uart after we call probe and it
returns successfully. Second, uart passes data between probe and attach
with softc. As it is now, we call probe twice, once in the bidding
process and once after bidding id done. However, the probe process for
uart isn't completely idempotent (we change state of the uart
sometimes). The second call can result in odd behavior (though so far
only in buggy version of other code I've not committed). The bigger
problem is the softc: newbus creates it, we populate it, then frees it
when we don't return 0 to claim the device. It then calls us again, we
repopulate it, and this time it doesn't free it before calling attach.
Returning 0 avoids both of these issues. The justification for doing it
in the commit that changed it was 'while I'm here', so there doesn't
seem to be a use case for it.

Sponsored by: Netflix
Reviewed by: andrew
Differential Revision: https://reviews.freebsd.org/D47095

Details

Provenance
impAuthored on Tue, Oct 15, 10:59 AM
Reviewer
andrew
Differential Revision
D47095: uart: Go back to returning '0' when we've probed the device.
Parents
rG28ce46d8625d: uart/pl011: Add support for computing rclk
Branches
Unknown
Tags
Unknown