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 <[email protected]> Acked-by: Rafael J. Wysocki <[email protected]> Reviewed-by: Andi Shyti <[email protected]> Signed-off-by: Wolfram Sang <[email protected]>
1 parent 3d6cd1a commit 29166fa

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

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)