summaryrefslogtreecommitdiffstats
path: root/drivers/acpi/arm64
diff options
context:
space:
mode:
authorLorenzo Pieralisi <lorenzo.pieralisi@arm.com>2016-11-21 05:01:40 -0500
committerWill Deacon <will.deacon@arm.com>2016-11-29 10:57:45 -0500
commitbdca0c077fc5c2a7bb405281263270070c67f917 (patch)
tree0ec8badbf941b0a19eea82bd6945cd852a8457d9 /drivers/acpi/arm64
parentd760a1baf20e067d3a063aa134834ddd3d183e2f (diff)
ACPI/IORT: Add node match function
Device drivers (eg ARM SMMU) need to know if a specific component is part of the IORT table, so that kernel data structures are not initialized at initcalls time if the respective component is not part of the IORT table. To this end, this patch adds a trivial function that allows detecting if a given IORT node type is present or not in the ACPI table, providing an ACPI IORT equivalent for of_find_matching_node(). Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> Reviewed-by: Tomasz Nowicki <tn@semihalf.com> Tested-by: Hanjun Guo <hanjun.guo@linaro.org> Tested-by: Tomasz Nowicki <tn@semihalf.com> Acked-by: Hanjun Guo <hanjun.guo@linaro.org> Cc: Hanjun Guo <hanjun.guo@linaro.org> Cc: Tomasz Nowicki <tn@semihalf.com> Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net> Signed-off-by: Will Deacon <will.deacon@arm.com>
Diffstat (limited to 'drivers/acpi/arm64')
-rw-r--r--drivers/acpi/arm64/iort.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/acpi/arm64/iort.c b/drivers/acpi/arm64/iort.c
index 1ac2720da96d..4bb6acbf881f 100644
--- a/drivers/acpi/arm64/iort.c
+++ b/drivers/acpi/arm64/iort.c
@@ -227,6 +227,21 @@ static struct acpi_iort_node *iort_scan_node(enum acpi_iort_node_type type,
227 return NULL; 227 return NULL;
228} 228}
229 229
230static acpi_status
231iort_match_type_callback(struct acpi_iort_node *node, void *context)
232{
233 return AE_OK;
234}
235
236bool iort_node_match(u8 type)
237{
238 struct acpi_iort_node *node;
239
240 node = iort_scan_node(type, iort_match_type_callback, NULL);
241
242 return node != NULL;
243}
244
230static acpi_status iort_match_node_callback(struct acpi_iort_node *node, 245static acpi_status iort_match_node_callback(struct acpi_iort_node *node,
231 void *context) 246 void *context)
232{ 247{