Fix bogus pass for syscon_generic introduced in r327621

ian@ pointed out that BUS_PASS_DEFAULT + $anything is bogus, given that
BUS_PASS_DEFAULT is defined as __INT_MAX. Instead, we take a page out of
imx6_usbphy's book and use BUS_PASS_DEFAULT - 1000 to achieve the desired
effect of syscon_generic attaching before if_awg and other potential
consumers, but late enough that more specialized implementations should have
no problem attaching instead.

Reported by:	ian
This commit is contained in:
Kyle Evans 2018-01-07 02:19:54 +00:00
parent f397a004de
commit ea9e0e28e0

View File

@ -206,6 +206,11 @@ static device_method_t syscon_generic_dmethods[] = {
DEFINE_CLASS_0(syscon_generic, syscon_generic_driver, syscon_generic_dmethods,
sizeof(struct syscon_generic_softc));
static devclass_t syscon_generic_devclass;
/*
* syscon_generic needs to attach before other devices that may require it, such
* as if_awg, but later than others to give way for more specialized syscon
* implementations.
*/
EARLY_DRIVER_MODULE(syscon_generic, simplebus, syscon_generic_driver,
syscon_generic_devclass, 0, 0, BUS_PASS_DEFAULT + BUS_PASS_ORDER_FIRST);
syscon_generic_devclass, 0, 0, BUS_PASS_DEFAULT - 1000);
MODULE_VERSION(syscon_generic, 1);