Attach acpi_perf early. Especially when it is being used to provide info
to other devices, it needs to be attached first. (Multi-pass newbus probes would be a better solution.)
This commit is contained in:
parent
d4af181c4d
commit
f2b3c68800
@ -141,6 +141,7 @@ static void
|
||||
acpi_perf_identify(driver_t *driver, device_t parent)
|
||||
{
|
||||
ACPI_HANDLE handle;
|
||||
device_t dev;
|
||||
|
||||
/* Make sure we're not being doubly invoked. */
|
||||
if (device_find_child(parent, "acpi_perf", -1) != NULL)
|
||||
@ -156,8 +157,12 @@ acpi_perf_identify(driver_t *driver, device_t parent)
|
||||
/*
|
||||
* Add a child to every CPU that has the right methods. In future
|
||||
* versions of the ACPI spec, CPUs can have different settings.
|
||||
* We probe this child now so that other devices that depend
|
||||
* on it (i.e., for info about supported states) will see it.
|
||||
*/
|
||||
if (BUS_ADD_CHILD(parent, 0, "acpi_perf", -1) == NULL)
|
||||
if ((dev = BUS_ADD_CHILD(parent, 0, "acpi_perf", -1)) != NULL)
|
||||
device_probe_and_attach(dev);
|
||||
else
|
||||
device_printf(parent, "add acpi_perf child failed\n");
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user