ACPI / property: Extend fwnode_property_* to data-only subnodes

Modify is_acpi_node() to return "true" for ACPI data-only subnodes as
well as for ACPI device objects and change the name of to_acpi_node()
to to_acpi_device_node() so it is clear that it covers ACPI device
objects only.  Accordingly, introduce to_acpi_data_node() to cover
data-only subnodes in an analogous way.

With that, make the fwnode_property_* family of functions work with
ACPI data-only subnodes introduced previously.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Tested-by: Mika Westerberg <mika.westerberg@linux.intel.com>
This commit is contained in:
Rafael J. Wysocki
2015-08-27 04:40:05 +02:00
parent 263b4c1a64
commit 3a7a2ab839
5 changed files with 174 additions and 62 deletions

View File

@@ -2083,11 +2083,11 @@ struct gpio_desc *fwnode_get_named_gpiod(struct fwnode_handle *fwnode,
&flags);
if (!IS_ERR(desc))
active_low = flags & OF_GPIO_ACTIVE_LOW;
} else if (is_acpi_node(fwnode)) {
} else if (is_acpi_device_node(fwnode)) {
struct acpi_gpio_info info;
desc = acpi_get_gpiod_by_index(to_acpi_node(fwnode), propname, 0,
&info);
desc = acpi_get_gpiod_by_index(to_acpi_device_node(fwnode),
propname, 0, &info);
if (!IS_ERR(desc))
active_low = info.active_low;
}