From bd05b47fbd8b7301983dc4ceaf0498fb8d5ca9f2 Mon Sep 17 00:00:00 2001 From: Olivier Certner Date: Fri, 10 Apr 2026 16:15:09 +0200 Subject: [PATCH] acpi_spmc(4): Small probe improvements/fixes Remove the test on presence of an ACPI handle, this is implied by ACPI_ID_PROBE() succeeding. Set 'sc->dev' early, so that acpi_spmc_check_dsm_set() using device_printf() will print the driver name. Add a missing newline after printing that more DSM functions are implemented then expected. Reviewed by: obiwac Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D56483 --- sys/dev/acpica/acpi_spmc.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/sys/dev/acpica/acpi_spmc.c b/sys/dev/acpica/acpi_spmc.c index ca7b3bd95ea..5be2ba439de 100644 --- a/sys/dev/acpica/acpi_spmc.c +++ b/sys/dev/acpica/acpi_spmc.c @@ -200,12 +200,13 @@ acpi_spmc_probe(device_t dev) } handle = acpi_get_handle(dev); - if (handle == NULL) - return (ENXIO); + /* ACPI_ID_PROBE() above cannot succeed without a handle. */ + MPASS(handle != NULL); sc = device_get_softc(dev); + sc->dev = dev; - /* Check which sets of DSM's are supported. */ + /* Check which sets of DSMs are supported. */ sc->dsm_sets = 0; acpi_spmc_check_dsm_set(sc, handle, &intel_dsm_set); @@ -286,7 +287,7 @@ acpi_spmc_check_dsm_set(struct acpi_spmc_softc *sc, ACPI_HANDLE handle, if ((dsms_supported & ~max_dsms) != 0) device_printf(sc->dev, "DSM set %s supports more DSMs than " - "expected (%#" PRIx64 " vs %#" PRIx64 ").", dsm_set->name, + "expected (%#" PRIx64 " vs %#" PRIx64 ").\n", dsm_set->name, dsms_supported, max_dsms); }