acpi_hpet: restore support for timers defined only in HPET table

This fixes a regress introduced in r339754.
After that change the code required that there is a HPET device
in the ACPI namespace.
The problem has been noticed on an PC Engines apu2 system.

While here, fix a small formatting issue.
This commit is contained in:
Andriy Gapon 2019-05-22 08:30:03 +00:00
parent d3bb120822
commit 804838e126

View File

@ -455,9 +455,12 @@ hpet_probe(device_t dev)
ACPI_FUNCTION_TRACE((char *)(uintptr_t) __func__);
if (acpi_disabled("hpet") || acpi_hpet_disabled)
return (ENXIO);
rv = ACPI_ID_PROBE(device_get_parent(dev), dev, hpet_ids, NULL);
if (acpi_get_handle(dev) != NULL)
rv = ACPI_ID_PROBE(device_get_parent(dev), dev, hpet_ids, NULL);
else
rv = 0;
if (rv <= 0)
device_set_desc(dev, "High Precision Event Timer");
device_set_desc(dev, "High Precision Event Timer");
return (rv);
}