diff mbox series

[2/6] ACPI: resource: Filter out the non memory resources in is_memory()

Message ID 20220816101629.69054-3-heikki.krogerus@linux.intel.com
State Accepted
Commit 6d2b5a1cf4dd943909a927133664ad1627783d95
Headers show
Series ACPI: New helper function acpi_dev_get_memory_resources() and a new ACPI ID | expand

Commit Message

Heikki Krogerus Aug. 16, 2022, 10:16 a.m. UTC
This will generalise the function so it should become
useful in more places.

Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
---
 drivers/acpi/resource.c | 3 +++
 1 file changed, 3 insertions(+)
diff mbox series

Patch

diff --git a/drivers/acpi/resource.c b/drivers/acpi/resource.c
index 510cdec375c4d..e644e90d18847 100644
--- a/drivers/acpi/resource.c
+++ b/drivers/acpi/resource.c
@@ -690,6 +690,9 @@  static int is_memory(struct acpi_resource *ares, void *not_used)
 
 	memset(&win, 0, sizeof(win));
 
+	if (acpi_dev_filter_resource_type(ares, IORESOURCE_MEM))
+		return 1;
+
 	return !(acpi_dev_resource_memory(ares, res)
 	       || acpi_dev_resource_address_space(ares, &win)
 	       || acpi_dev_resource_ext_address_space(ares, &win));