Skip to content

Commit 29166fa

Browse files
hkallweitwsakernel
authored andcommitted
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>
1 parent 3d6cd1a commit 29166fa

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

include/linux/acpi.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1539,4 +1539,9 @@ static inline void acpi_device_notify(struct device *dev) { }
15391539
static inline void acpi_device_notify_remove(struct device *dev) { }
15401540
#endif
15411541

1542+
static inline void acpi_use_parent_companion(struct device *dev)
1543+
{
1544+
ACPI_COMPANION_SET(dev, ACPI_COMPANION(dev->parent));
1545+
}
1546+
15421547
#endif /*_LINUX_ACPI_H*/

0 commit comments

Comments
 (0)