diff options
author | Sakari Ailus <sakari.ailus@linux.intel.com> | 2017-07-11 17:20:20 +0200 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2017-07-12 13:32:46 +0200 |
commit | e8158b486d5f3f55cf372c5a32b42f263bf7f123 (patch) | |
tree | ccec68fe1452a4df5f30da226623aa6dc5e9e7ec /drivers/base/property.c | |
parent | device property: Add fwnode_graph_get_port_parent (diff) | |
download | linux-e8158b486d5f3f55cf372c5a32b42f263bf7f123.tar.xz linux-e8158b486d5f3f55cf372c5a32b42f263bf7f123.zip |
device property: Introduce fwnode_call_bool_op() for ops that return bool
fwnode_call_int_op() isn't suitable for calling ops that return bool
since it effectively causes the result returned to the user to be
true when an op hasn't been defined or the fwnode is NULL.
Address this by introducing fwnode_call_bool_op() for calling ops
that return bool.
Fixes: 3708184afc77 "device property: Move FW type specific functionality to FW specific files"
Fixes: 2294b3af05e9 "device property: Introduce fwnode_device_is_available()"
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/base/property.c')
-rw-r--r-- | drivers/base/property.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/base/property.c b/drivers/base/property.c index 692007e5a94b..edf02c1b5845 100644 --- a/drivers/base/property.c +++ b/drivers/base/property.c @@ -253,10 +253,10 @@ bool fwnode_property_present(struct fwnode_handle *fwnode, const char *propname) { bool ret; - ret = fwnode_call_int_op(fwnode, property_present, propname); + ret = fwnode_call_bool_op(fwnode, property_present, propname); if (ret == false && !IS_ERR_OR_NULL(fwnode) && !IS_ERR_OR_NULL(fwnode->secondary)) - ret = fwnode_call_int_op(fwnode->secondary, property_present, + ret = fwnode_call_bool_op(fwnode->secondary, property_present, propname); return ret; } @@ -1027,7 +1027,7 @@ EXPORT_SYMBOL_GPL(fwnode_handle_put); */ bool fwnode_device_is_available(struct fwnode_handle *fwnode) { - return fwnode_call_int_op(fwnode, device_is_available); + return fwnode_call_bool_op(fwnode, device_is_available); } EXPORT_SYMBOL_GPL(fwnode_device_is_available); |