git: 6d5f5f730a42 - main - linuxkpi: Add `to_acpi_device_node()` and `ACPI_COMPANION()`

From: Jean-Sébastien Pédron <dumbbell_at_FreeBSD.org>
Date: Thu, 09 Jul 2026 18:34:20 UTC
The branch main has been updated by dumbbell:

URL: https://cgit.FreeBSD.org/src/commit/?id=6d5f5f730a42eb49240bf1a21a65f4c5f7fd2843

commit 6d5f5f730a42eb49240bf1a21a65f4c5f7fd2843
Author:     Jean-Sébastien Pédron <dumbbell@FreeBSD.org>
AuthorDate: 2026-06-12 14:02:54 +0000
Commit:     Jean-Sébastien Pédron <dumbbell@FreeBSD.org>
CommitDate: 2026-07-09 18:33:49 +0000

    linuxkpi: Add `to_acpi_device_node()` and `ACPI_COMPANION()`
    
    The former is called by the latter. We return NULL because linuxkpi does
    not implement ACPI (pseudo?) devices associated to regular devices.
    
    The amdgpu DRM driver started to use `ACPI_COMPANION()` in Linux 6.13.
    
    Reviewed by:    emaste
    Sponsored by:   The FreeBSD Foundation
    Differential Revision: https://reviews.freebsd.org/D57577
---
 sys/compat/linuxkpi/common/include/linux/acpi.h | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/sys/compat/linuxkpi/common/include/linux/acpi.h b/sys/compat/linuxkpi/common/include/linux/acpi.h
index a764a975c983..8b86fdfe9044 100644
--- a/sys/compat/linuxkpi/common/include/linux/acpi.h
+++ b/sys/compat/linuxkpi/common/include/linux/acpi.h
@@ -44,6 +44,14 @@
 static inline void acpi_dev_put(struct acpi_device *adev) {}
 #define	acpi_handle_debug(handle, fmt, ...)
 
+static inline struct acpi_device *
+to_acpi_device_node(const struct fwnode_handle *fwnode)
+{
+	return (NULL);
+}
+
+#define	ACPI_COMPANION(dev)	to_acpi_device_node((dev)->fwnode)
+
 #endif
 
 #endif /* _LINUXKPI_LINUX_ACPI_H_ */