summaryrefslogtreecommitdiff
path: root/include/linux/acpi.h
diff options
context:
space:
mode:
authorHeiner Kallweit <hkallweit1@gmail.com>2023-10-15 23:34:25 +0200
committerWolfram Sang <wsa@kernel.org>2023-10-28 15:30:24 +0200
commit29166faac5486cbc34228431cd049e1c1be451ac (patch)
tree1f213c803d9075d76bfe7bdc5eed5ea7d3443ba1 /include/linux/acpi.h
parent3d6cd1af37cb937bb8b65e6047dffc2fb5be7d1c (diff)
ACPI: Add helper acpi_use_parent_companion
In several drivers devices use the ACPI companion of the parent. Add a helper for this use case to avoid code duplication. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Reviewed-by: Andi Shyti <andi.shyti@kernel.org> Signed-off-by: Wolfram Sang <wsa@kernel.org>
Diffstat (limited to 'include/linux/acpi.h')
-rw-r--r--include/linux/acpi.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/linux/acpi.h b/include/linux/acpi.h
index a73246c3c35e..d17a280ce7c7 100644
--- a/include/linux/acpi.h
+++ b/include/linux/acpi.h
@@ -1539,4 +1539,9 @@ static inline void acpi_device_notify(struct device *dev) { }
static inline void acpi_device_notify_remove(struct device *dev) { }
#endif
+static inline void acpi_use_parent_companion(struct device *dev)
+{
+ ACPI_COMPANION_SET(dev, ACPI_COMPANION(dev->parent));
+}
+
#endif /*_LINUX_ACPI_H*/