summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/acpi.h4
-rw-r--r--include/linux/device.h3
-rw-r--r--include/linux/fwnode.h1
3 files changed, 6 insertions, 2 deletions
diff --git a/include/linux/acpi.h b/include/linux/acpi.h
index ec488d03b518..dd12127f171c 100644
--- a/include/linux/acpi.h
+++ b/include/linux/acpi.h
@@ -54,8 +54,8 @@ static inline acpi_handle acpi_device_handle(struct acpi_device *adev)
}
#define ACPI_COMPANION(dev) acpi_node((dev)->fwnode)
-#define ACPI_COMPANION_SET(dev, adev) (dev)->fwnode = (adev) ? \
- acpi_fwnode_handle(adev) : NULL
+#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)
diff --git a/include/linux/device.h b/include/linux/device.h
index badef20b876a..324d02add7b4 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -940,6 +940,9 @@ extern void unlock_device_hotplug(void);
extern int lock_device_hotplug_sysfs(void);
extern int device_offline(struct device *dev);
extern int device_online(struct device *dev);
+extern void set_primary_fwnode(struct device *dev, struct fwnode_handle *fwnode);
+extern void set_secondary_fwnode(struct device *dev, struct fwnode_handle *fwnode);
+
/*
* Root device objects for grouping under /sys/devices
*/
diff --git a/include/linux/fwnode.h b/include/linux/fwnode.h
index 17bb5f039509..fc30b84b532a 100644
--- a/include/linux/fwnode.h
+++ b/include/linux/fwnode.h
@@ -20,6 +20,7 @@ enum fwnode_type {
struct fwnode_handle {
enum fwnode_type type;
+ struct fwnode_handle *secondary;
};
#endif