diff options
Diffstat (limited to 'include/linux/acpi.h')
-rw-r--r-- | include/linux/acpi.h | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/include/linux/acpi.h b/include/linux/acpi.h index 24c7aa8b1d20..dd12127f171c 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h | |||
@@ -53,10 +53,16 @@ static inline acpi_handle acpi_device_handle(struct acpi_device *adev) | |||
53 | return adev ? adev->handle : NULL; | 53 | return adev ? adev->handle : NULL; |
54 | } | 54 | } |
55 | 55 | ||
56 | #define ACPI_COMPANION(dev) ((dev)->acpi_node.companion) | 56 | #define ACPI_COMPANION(dev) acpi_node((dev)->fwnode) |
57 | #define ACPI_COMPANION_SET(dev, adev) ACPI_COMPANION(dev) = (adev) | 57 | #define ACPI_COMPANION_SET(dev, adev) set_primary_fwnode(dev, (adev) ? \ |
58 | acpi_fwnode_handle(adev) : NULL) | ||
58 | #define ACPI_HANDLE(dev) acpi_device_handle(ACPI_COMPANION(dev)) | 59 | #define ACPI_HANDLE(dev) acpi_device_handle(ACPI_COMPANION(dev)) |
59 | 60 | ||
61 | static inline bool has_acpi_companion(struct device *dev) | ||
62 | { | ||
63 | return is_acpi_node(dev->fwnode); | ||
64 | } | ||
65 | |||
60 | static inline void acpi_preset_companion(struct device *dev, | 66 | static inline void acpi_preset_companion(struct device *dev, |
61 | struct acpi_device *parent, u64 addr) | 67 | struct acpi_device *parent, u64 addr) |
62 | { | 68 | { |
@@ -471,6 +477,11 @@ static inline struct fwnode_handle *acpi_fwnode_handle(struct acpi_device *adev) | |||
471 | return NULL; | 477 | return NULL; |
472 | } | 478 | } |
473 | 479 | ||
480 | static inline bool has_acpi_companion(struct device *dev) | ||
481 | { | ||
482 | return false; | ||
483 | } | ||
484 | |||
474 | static inline const char *acpi_dev_name(struct acpi_device *adev) | 485 | static inline const char *acpi_dev_name(struct acpi_device *adev) |
475 | { | 486 | { |
476 | return NULL; | 487 | return NULL; |