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>
This commit is contained in:

committed by
Rafael J. Wysocki

parent
3b27d00e7b
commit
2294b3af05
@@ -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,
|
||||
|
Reference in New Issue
Block a user