OSDN Git Service

Merge tag 'arm64-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64...
[uclinux-h8/linux.git] / include / linux / acpi.h
index de4e86f..e4da5e3 100644 (file)
@@ -53,10 +53,16 @@ static inline acpi_handle acpi_device_handle(struct acpi_device *adev)
        return adev ? adev->handle : NULL;
 }
 
-#define ACPI_COMPANION(dev)            ((dev)->acpi_node.companion)
-#define ACPI_COMPANION_SET(dev, adev)  ACPI_COMPANION(dev) = (adev)
+#define ACPI_COMPANION(dev)            acpi_node((dev)->fwnode)
+#define ACPI_COMPANION_SET(dev, adev)  set_primary_fwnode(dev, (adev) ? \
+       acpi_fwnode_handle(adev) : NULL)
 #define ACPI_HANDLE(dev)               acpi_device_handle(ACPI_COMPANION(dev))
 
+static inline bool has_acpi_companion(struct device *dev)
+{
+       return is_acpi_node(dev->fwnode);
+}
+
 static inline void acpi_preset_companion(struct device *dev,
                                         struct acpi_device *parent, u64 addr)
 {
@@ -477,6 +483,11 @@ static inline struct fwnode_handle *acpi_fwnode_handle(struct acpi_device *adev)
        return NULL;
 }
 
+static inline bool has_acpi_companion(struct device *dev)
+{
+       return false;
+}
+
 static inline const char *acpi_dev_name(struct acpi_device *adev)
 {
        return NULL;