aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/base
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2015-08-26 22:40:05 -0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2015-09-14 19:47:34 -0400
commit3a7a2ab839ad18c2d542b40f4a647c98d068e55a (patch)
treefca2c5a901c97d41b2aa3ad44d72299b32226183 /drivers/base
parent263b4c1a64bc12470684aeaf7c44f03d31716819 (diff)
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>
Diffstat (limited to 'drivers/base')
-rw-r--r--drivers/base/property.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/base/property.c b/drivers/base/property.c
index 2d75366c61e0..ca118169a6c5 100644
--- a/drivers/base/property.c
+++ b/drivers/base/property.c
@@ -134,7 +134,7 @@ bool fwnode_property_present(struct fwnode_handle *fwnode, const char *propname)
134 if (is_of_node(fwnode)) 134 if (is_of_node(fwnode))
135 return of_property_read_bool(to_of_node(fwnode), propname); 135 return of_property_read_bool(to_of_node(fwnode), propname);
136 else if (is_acpi_node(fwnode)) 136 else if (is_acpi_node(fwnode))
137 return !acpi_dev_prop_get(to_acpi_node(fwnode), propname, NULL); 137 return !acpi_node_prop_get(fwnode, propname, NULL);
138 138
139 return !!pset_prop_get(to_pset(fwnode), propname); 139 return !!pset_prop_get(to_pset(fwnode), propname);
140} 140}
@@ -298,8 +298,8 @@ EXPORT_SYMBOL_GPL(device_property_read_string);
298 _ret_ = OF_DEV_PROP_READ_ARRAY(to_of_node(_fwnode_), _propname_, \ 298 _ret_ = OF_DEV_PROP_READ_ARRAY(to_of_node(_fwnode_), _propname_, \
299 _type_, _val_, _nval_); \ 299 _type_, _val_, _nval_); \
300 else if (is_acpi_node(_fwnode_)) \ 300 else if (is_acpi_node(_fwnode_)) \
301 _ret_ = acpi_dev_prop_read(to_acpi_node(_fwnode_), _propname_, \ 301 _ret_ = acpi_node_prop_read(_fwnode_, _propname_, _proptype_, \
302 _proptype_, _val_, _nval_); \ 302 _val_, _nval_); \
303 else if (is_pset(_fwnode_)) \ 303 else if (is_pset(_fwnode_)) \
304 _ret_ = pset_prop_read_array(to_pset(_fwnode_), _propname_, \ 304 _ret_ = pset_prop_read_array(to_pset(_fwnode_), _propname_, \
305 _proptype_, _val_, _nval_); \ 305 _proptype_, _val_, _nval_); \
@@ -440,8 +440,8 @@ int fwnode_property_read_string_array(struct fwnode_handle *fwnode,
440 propname, val, nval) : 440 propname, val, nval) :
441 of_property_count_strings(to_of_node(fwnode), propname); 441 of_property_count_strings(to_of_node(fwnode), propname);
442 else if (is_acpi_node(fwnode)) 442 else if (is_acpi_node(fwnode))
443 return acpi_dev_prop_read(to_acpi_node(fwnode), propname, 443 return acpi_node_prop_read(fwnode, propname, DEV_PROP_STRING,
444 DEV_PROP_STRING, val, nval); 444 val, nval);
445 else if (is_pset(fwnode)) 445 else if (is_pset(fwnode))
446 return pset_prop_read_array(to_pset(fwnode), propname, 446 return pset_prop_read_array(to_pset(fwnode), propname,
447 DEV_PROP_STRING, val, nval); 447 DEV_PROP_STRING, val, nval);
@@ -470,8 +470,8 @@ int fwnode_property_read_string(struct fwnode_handle *fwnode,
470 if (is_of_node(fwnode)) 470 if (is_of_node(fwnode))
471 return of_property_read_string(to_of_node(fwnode), propname, val); 471 return of_property_read_string(to_of_node(fwnode), propname, val);
472 else if (is_acpi_node(fwnode)) 472 else if (is_acpi_node(fwnode))
473 return acpi_dev_prop_read(to_acpi_node(fwnode), propname, 473 return acpi_node_prop_read(fwnode, propname, DEV_PROP_STRING,
474 DEV_PROP_STRING, val, 1); 474 val, 1);
475 475
476 return pset_prop_read_array(to_pset(fwnode), propname, 476 return pset_prop_read_array(to_pset(fwnode), propname,
477 DEV_PROP_STRING, val, 1); 477 DEV_PROP_STRING, val, 1);
@@ -495,7 +495,7 @@ struct fwnode_handle *device_get_next_child_node(struct device *dev,
495 } else if (IS_ENABLED(CONFIG_ACPI)) { 495 } else if (IS_ENABLED(CONFIG_ACPI)) {
496 struct acpi_device *node; 496 struct acpi_device *node;
497 497
498 node = acpi_get_next_child(dev, to_acpi_node(child)); 498 node = acpi_get_next_child(dev, to_acpi_device_node(child));
499 if (node) 499 if (node)
500 return acpi_fwnode_handle(node); 500 return acpi_fwnode_handle(node);
501 } 501 }