driver core / ACPI: Represent ACPI companions using fwnode_handle
Now that we have struct fwnode_handle, we can use that to point to ACPI companions from struct device objects instead of pointing to struct acpi_device directly. There are two benefits from that. First, the somewhat ugly and hackish struct acpi_dev_node can be dropped and, second, the same struct fwnode_handle pointer can be used in the future to point to other (non-ACPI) firmware device node types. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Acked-by: Grant Likely <grant.likely@linaro.org>
This commit is contained in:
@@ -386,7 +386,8 @@ static inline bool is_acpi_node(struct fwnode_handle *fwnode)
|
||||
|
||||
static inline struct acpi_device *acpi_node(struct fwnode_handle *fwnode)
|
||||
{
|
||||
return fwnode ? container_of(fwnode, struct acpi_device, fwnode) : NULL;
|
||||
return is_acpi_node(fwnode) ?
|
||||
container_of(fwnode, struct acpi_device, fwnode) : NULL;
|
||||
}
|
||||
|
||||
static inline struct fwnode_handle *acpi_fwnode_handle(struct acpi_device *adev)
|
||||
|
Fai riferimento in un nuovo problema
Block a user