diff options
author | Sakari Ailus <sakari.ailus@linux.intel.com> | 2017-06-06 12:37:39 +0300 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2017-06-22 02:55:34 +0200 |
commit | 2294b3af05e9b3fe0b84a78971e709037bd7593c (patch) | |
tree | 36e1766ebc6f3d159ab2bdfca2b71244689b503c /drivers/acpi/property.c | |
parent | 3b27d00e7b6d7c889d87fd00df600c495b968e30 (diff) |
device property: Introduce fwnode_device_is_available()
Add fwnode_device_is_available() to tell whether the device corresponding
to a certain fwnode_handle is available for use.
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/acpi/property.c')
-rw-r--r-- | drivers/acpi/property.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/acpi/property.c b/drivers/acpi/property.c index a24ca61294eb..917c789f953d 100644 --- a/drivers/acpi/property.c +++ b/drivers/acpi/property.c @@ -1121,6 +1121,14 @@ int acpi_graph_get_remote_endpoint(struct fwnode_handle *fwnode, return 0; } +static bool acpi_fwnode_device_is_available(struct fwnode_handle *fwnode) +{ + if (!is_acpi_device_node(fwnode)) + return false; + + return acpi_device_is_present(to_acpi_device_node(fwnode)); +} + static bool acpi_fwnode_property_present(struct fwnode_handle *fwnode, const char *propname) { @@ -1216,6 +1224,7 @@ static int acpi_fwnode_graph_parse_endpoint(struct fwnode_handle *fwnode, } const struct fwnode_operations acpi_fwnode_ops = { + .device_is_available = acpi_fwnode_device_is_available, .property_present = acpi_fwnode_property_present, .property_read_int_array = acpi_fwnode_property_read_int_array, .property_read_string_array = acpi_fwnode_property_read_string_array, |