git: 5ca875f3be03 - main - acpi: Export handler invoke helpers, use them in acpi_lid
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 22 Jun 2026 21:42:41 UTC
The branch main has been updated by olce:
URL: https://cgit.FreeBSD.org/src/commit/?id=5ca875f3be030eb8ac80d8fb1b8f8018dc5eeb09
commit 5ca875f3be030eb8ac80d8fb1b8f8018dc5eeb09
Author: Olivier Certner <olce@FreeBSD.org>
AuthorDate: 2026-06-04 10:55:45 +0000
Commit: Olivier Certner <olce@FreeBSD.org>
CommitDate: 2026-06-22 21:40:14 +0000
acpi: Export handler invoke helpers, use them in acpi_lid
Removes duplicated code.
No functional change (intended).
Reviewed by: obiwac
Event: Halifax Hackathon 202606
Sponsored by: The FreeBSD Foundation
Pull Request: https://github.com/OlCe2/freebsd-src/pull/8
---
sys/dev/acpica/acpi.c | 4 ++--
sys/dev/acpica/acpi_lid.c | 4 ++--
sys/dev/acpica/acpivar.h | 3 +++
3 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/sys/dev/acpica/acpi.c b/sys/dev/acpica/acpi.c
index 1e21d4572fac..b689e936916b 100644
--- a/sys/dev/acpica/acpi.c
+++ b/sys/dev/acpica/acpi.c
@@ -4142,13 +4142,13 @@ acpi_system_eventhandler_wakeup(struct acpi_softc *const sc,
/*
* ACPICA Event Handlers (FixedEvent, also called from button notify handler)
*/
-static void
+void
acpi_invoke_sleep_eventhandler(const enum power_stype *const stype)
{
EVENTHANDLER_INVOKE(acpi_sleep_event, *stype);
}
-static void
+void
acpi_invoke_wake_eventhandler(const enum power_stype *const stype)
{
EVENTHANDLER_INVOKE(acpi_wakeup_event, *stype);
diff --git a/sys/dev/acpica/acpi_lid.c b/sys/dev/acpica/acpi_lid.c
index fb8755d9f0fe..1d5249a19731 100644
--- a/sys/dev/acpica/acpi_lid.c
+++ b/sys/dev/acpica/acpi_lid.c
@@ -235,9 +235,9 @@ acpi_lid_notify_status_changed(void *arg)
sc->lid_status ? "opened" : "closed");
if (sc->lid_status == 0)
- EVENTHANDLER_INVOKE(acpi_sleep_event, acpi_sc->acpi_lid_switch_stype);
+ acpi_invoke_sleep_eventhandler(&acpi_sc->acpi_lid_switch_stype);
else
- EVENTHANDLER_INVOKE(acpi_wakeup_event, acpi_sc->acpi_lid_switch_stype);
+ acpi_invoke_wake_eventhandler(&acpi_sc->acpi_lid_switch_stype);
out:
ACPI_SERIAL_END(lid);
diff --git a/sys/dev/acpica/acpivar.h b/sys/dev/acpica/acpivar.h
index aa30e5fef26e..9facbaea595a 100644
--- a/sys/dev/acpica/acpivar.h
+++ b/sys/dev/acpica/acpivar.h
@@ -475,6 +475,9 @@ EVENTHANDLER_DECLARE(acpi_video_event, acpi_event_handler_t);
EVENTHANDLER_DECLARE(acpi_post_dev_suspend, acpi_event_handler_t);
EVENTHANDLER_DECLARE(acpi_pre_dev_resume, acpi_event_handler_t);
+void acpi_invoke_sleep_eventhandler(const enum power_stype *stype);
+void acpi_invoke_wake_eventhandler(const enum power_stype *stype);
+
/* Device power control. */
ACPI_STATUS acpi_pwr_wake_enable(ACPI_HANDLE consumer, int enable);
ACPI_STATUS acpi_pwr_switch_consumer(ACPI_HANDLE consumer, int state);