aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/acpi.h
diff options
context:
space:
mode:
authorBjorn Helgaas <bhelgaas@google.com>2016-11-30 15:47:13 -0500
committerBjorn Helgaas <helgaas@kernel.org>2016-12-01 15:59:32 -0500
commit00710984eac523ffed4e92850511d7610cfe908b (patch)
tree65b78c486753503d73a6faa02d07f577667a7a41 /include/linux/acpi.h
parent1001354ca34179f3db924eb66672442a173147dc (diff)
ACPI: Add acpi_resource_consumer() to find device that claims a resource
Add acpi_resource_consumer(). This takes a struct resource and searches the ACPI namespace for a device whose current resource settings (_CRS) includes the resource. It returns the device if it exists, or NULL if no device uses the resource. If more than one device uses the resource (this may happen in the case of bridges), acpi_resource_consumer() returns the first one found by acpi_get_devices() in its modified depth-first walk of the namespace. Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'include/linux/acpi.h')
-rw-r--r--include/linux/acpi.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/linux/acpi.h b/include/linux/acpi.h
index ddbeda6dbdc8..b00ad73c946d 100644
--- a/include/linux/acpi.h
+++ b/include/linux/acpi.h
@@ -419,6 +419,8 @@ static inline int acpi_dev_filter_resource_type_cb(struct acpi_resource *ares,
419 return acpi_dev_filter_resource_type(ares, (unsigned long)arg); 419 return acpi_dev_filter_resource_type(ares, (unsigned long)arg);
420} 420}
421 421
422struct acpi_device *acpi_resource_consumer(struct resource *res);
423
422int acpi_check_resource_conflict(const struct resource *res); 424int acpi_check_resource_conflict(const struct resource *res);
423 425
424int acpi_check_region(resource_size_t start, resource_size_t n, 426int acpi_check_region(resource_size_t start, resource_size_t n,
@@ -762,6 +764,11 @@ static inline int acpi_reconfig_notifier_unregister(struct notifier_block *nb)
762 return -EINVAL; 764 return -EINVAL;
763} 765}
764 766
767static inline struct acpi_device *acpi_resource_consumer(struct resource *res)
768{
769 return NULL;
770}
771
765#endif /* !CONFIG_ACPI */ 772#endif /* !CONFIG_ACPI */
766 773
767#ifdef CONFIG_ACPI_HOTPLUG_IOAPIC 774#ifdef CONFIG_ACPI_HOTPLUG_IOAPIC