mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 02:32:09 -04:00
ACPI / OF: Rename of_node() and acpi_node() to to_of_node() and to_acpi_node()
Commit 8a0662d9 introduced of_node and acpi_node symbols in global namespace
but there were already ~63 of_node local variables or function parameters
(no single acpi_node though, but anyway).
After debugging undefined but used of_node local varible (which turned out
to reference static function of_node() instead) it became clear that the names
for the functions are too short and too generic for global scope.
Signed-off-by: Alexander Sverdlin <[email protected]>
Signed-off-by: Rafael J. Wysocki <[email protected]>
This commit is contained in:
parent
b953c0d234
commit
c181fb3e72
6 changed files with 21 additions and 21 deletions
|
|
@ -128,9 +128,9 @@ EXPORT_SYMBOL_GPL(device_property_present);
|
|||
bool fwnode_property_present(struct fwnode_handle *fwnode, const char *propname)
|
||||
{
|
||||
if (is_of_node(fwnode))
|
||||
return of_property_read_bool(of_node(fwnode), propname);
|
||||
return of_property_read_bool(to_of_node(fwnode), propname);
|
||||
else if (is_acpi_node(fwnode))
|
||||
return !acpi_dev_prop_get(acpi_node(fwnode), propname, NULL);
|
||||
return !acpi_dev_prop_get(to_acpi_node(fwnode), propname, NULL);
|
||||
|
||||
return !!pset_prop_get(to_pset(fwnode), propname);
|
||||
}
|
||||
|
|
@ -285,10 +285,10 @@ EXPORT_SYMBOL_GPL(device_property_read_string);
|
|||
({ \
|
||||
int _ret_; \
|
||||
if (is_of_node(_fwnode_)) \
|
||||
_ret_ = OF_DEV_PROP_READ_ARRAY(of_node(_fwnode_), _propname_, \
|
||||
_ret_ = OF_DEV_PROP_READ_ARRAY(to_of_node(_fwnode_), _propname_, \
|
||||
_type_, _val_, _nval_); \
|
||||
else if (is_acpi_node(_fwnode_)) \
|
||||
_ret_ = acpi_dev_prop_read(acpi_node(_fwnode_), _propname_, \
|
||||
_ret_ = acpi_dev_prop_read(to_acpi_node(_fwnode_), _propname_, \
|
||||
_proptype_, _val_, _nval_); \
|
||||
else \
|
||||
_ret_ = pset_prop_read_array(to_pset(_fwnode_), _propname_, \
|
||||
|
|
@ -424,11 +424,11 @@ int fwnode_property_read_string_array(struct fwnode_handle *fwnode,
|
|||
{
|
||||
if (is_of_node(fwnode))
|
||||
return val ?
|
||||
of_property_read_string_array(of_node(fwnode), propname,
|
||||
val, nval) :
|
||||
of_property_count_strings(of_node(fwnode), propname);
|
||||
of_property_read_string_array(to_of_node(fwnode),
|
||||
propname, val, nval) :
|
||||
of_property_count_strings(to_of_node(fwnode), propname);
|
||||
else if (is_acpi_node(fwnode))
|
||||
return acpi_dev_prop_read(acpi_node(fwnode), propname,
|
||||
return acpi_dev_prop_read(to_acpi_node(fwnode), propname,
|
||||
DEV_PROP_STRING, val, nval);
|
||||
|
||||
return pset_prop_read_array(to_pset(fwnode), propname,
|
||||
|
|
@ -455,9 +455,9 @@ int fwnode_property_read_string(struct fwnode_handle *fwnode,
|
|||
const char *propname, const char **val)
|
||||
{
|
||||
if (is_of_node(fwnode))
|
||||
return of_property_read_string(of_node(fwnode), propname, val);
|
||||
return of_property_read_string(to_of_node(fwnode), propname, val);
|
||||
else if (is_acpi_node(fwnode))
|
||||
return acpi_dev_prop_read(acpi_node(fwnode), propname,
|
||||
return acpi_dev_prop_read(to_acpi_node(fwnode), propname,
|
||||
DEV_PROP_STRING, val, 1);
|
||||
|
||||
return -ENXIO;
|
||||
|
|
@ -475,13 +475,13 @@ struct fwnode_handle *device_get_next_child_node(struct device *dev,
|
|||
if (IS_ENABLED(CONFIG_OF) && dev->of_node) {
|
||||
struct device_node *node;
|
||||
|
||||
node = of_get_next_available_child(dev->of_node, of_node(child));
|
||||
node = of_get_next_available_child(dev->of_node, to_of_node(child));
|
||||
if (node)
|
||||
return &node->fwnode;
|
||||
} else if (IS_ENABLED(CONFIG_ACPI)) {
|
||||
struct acpi_device *node;
|
||||
|
||||
node = acpi_get_next_child(dev, acpi_node(child));
|
||||
node = acpi_get_next_child(dev, to_acpi_node(child));
|
||||
if (node)
|
||||
return acpi_fwnode_handle(node);
|
||||
}
|
||||
|
|
@ -500,7 +500,7 @@ EXPORT_SYMBOL_GPL(device_get_next_child_node);
|
|||
void fwnode_handle_put(struct fwnode_handle *fwnode)
|
||||
{
|
||||
if (is_of_node(fwnode))
|
||||
of_node_put(of_node(fwnode));
|
||||
of_node_put(to_of_node(fwnode));
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(fwnode_handle_put);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue