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>
This commit is contained in:
Heiner Kallweit
2023-10-15 23:34:25 +02:00
committed by Wolfram Sang
parent 3d6cd1af37
commit 29166faac5

View File

@@ -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*/