示例#1
0
文件: property.c 项目: 168519/linux
/**
 * device_property_present - check if a property of a device is present
 * @dev: Device whose property is being checked
 * @propname: Name of the property
 *
 * Check if property @propname is present in the device firmware description.
 */
bool device_property_present(struct device *dev, const char *propname)
{
	if (IS_ENABLED(CONFIG_OF) && dev->of_node)
		return of_property_read_bool(dev->of_node, propname);

	return !acpi_dev_prop_get(ACPI_COMPANION(dev), propname, NULL);
}
示例#2
0
/**
 * fwnode_property_present - check if a property of a firmware node is present
 * @fwnode: Firmware node whose property to check
 * @propname: Name of the property
 */
bool fwnode_property_present(struct fwnode_handle *fwnode, const char *propname)
{
    if (is_of_node(fwnode))
        return of_property_read_bool(to_of_node(fwnode), propname);
    else if (is_acpi_node(fwnode))
        return !acpi_dev_prop_get(to_acpi_node(fwnode), propname, NULL);

    return !!pset_prop_get(to_pset(fwnode), propname);
}