ACPI/IORT: Look up IORT node through struct fwnode_handle pointer
authorHanjun Guo <hanjun.guo@linaro.org>
Fri, 13 Oct 2017 07:09:47 +0000 (15:09 +0800)
committerLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Mon, 16 Oct 2017 13:29:45 +0000 (14:29 +0100)
commit0a71d8b95f8adc343d986bf3093fc1baf59df4b1
treee857218d7a5d9983c8467282a0f1951a0c4b0081
parent896dd2c3248422e1e7711cc582615844e2f9de86
ACPI/IORT: Look up IORT node through struct fwnode_handle pointer

Current IORT code provides a function (ie iort_get_fwnode())
which looks up a struct fwnode_handle pointer through a
struct acpi_iort_node pointer for SMMU components but it
lacks a function that implements the reverse look-up, namely
struct fwnode_handle* -> struct acpi_iort_node*.

Devices that are not IORT named components cannot be retrieved through
their associated IORT named component scan interface because they just
are not represented in the ACPI namespace; the reverse look-up is
therefore required for all platform devices that represent IORT nodes
(eg SMMUs) so that the struct acpi_iort_node* can be retrieved from the
struct device->fwnode pointer.

Signed-off-by: Hanjun Guo <hanjun.guo@linaro.org>
[lorenzo.pieralisi@arm.com: re-indented/rewrote the commit log]
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
drivers/acpi/arm64/iort.c