summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2017-10-04 01:44:38 +0200
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2017-10-04 01:44:38 +0200
commitb2b8a1ee170ebc4f5456d5b7b2c6c1093d3b48c1 (patch)
tree8c84f97330e9febd3107dd1650eb93cc3e23a3ef
parent9ec3dfb984862c8aa6f0af3a464005ac9d87bbfb (diff)
parentda99974859c234b6d4007bb537f904446aa0c124 (diff)
downloadlinux-b2b8a1ee170ebc4f5456d5b7b2c6c1093d3b48c1.tar.gz
Merge branch 'acpi-properties' into linux-next
* acpi-properties: ACPI: properties: Align return codes of __acpi_node_get_property_reference()
-rw-r--r--drivers/acpi/property.c19
-rw-r--r--drivers/base/property.c4
2 files changed, 13 insertions, 10 deletions
diff --git a/drivers/acpi/property.c b/drivers/acpi/property.c
index 3fb8ff5..5a8ac5e 100644
--- a/drivers/acpi/property.c
+++ b/drivers/acpi/property.c
@@ -571,10 +571,9 @@ static int acpi_data_get_property_array(const struct acpi_device_data *data,
* }
* }
*
- * Calling this function with index %2 return %-ENOENT and with index %3
- * returns the last entry. If the property does not contain any more values
- * %-ENODATA is returned. The NULL entry must be single integer and
- * preferably contain value %0.
+ * Calling this function with index %2 or index %3 return %-ENOENT. If the
+ * property does not contain any more values %-ENOENT is returned. The NULL
+ * entry must be single integer and preferably contain value %0.
*
* Return: %0 on success, negative error code on failure.
*/
@@ -590,7 +589,7 @@ int __acpi_node_get_property_reference(const struct fwnode_handle *fwnode,
data = acpi_device_data_of_node(fwnode);
if (!data)
- return -EINVAL;
+ return -ENOENT;
ret = acpi_data_get_property(data, propname, ACPI_TYPE_ANY, &obj);
if (ret)
@@ -635,7 +634,7 @@ int __acpi_node_get_property_reference(const struct fwnode_handle *fwnode,
ret = acpi_bus_get_device(element->reference.handle,
&device);
if (ret)
- return -ENODEV;
+ return -EINVAL;
nargs = 0;
element++;
@@ -649,11 +648,11 @@ int __acpi_node_get_property_reference(const struct fwnode_handle *fwnode,
else if (type == ACPI_TYPE_LOCAL_REFERENCE)
break;
else
- return -EPROTO;
+ return -EINVAL;
}
if (nargs > MAX_ACPI_REFERENCE_ARGS)
- return -EPROTO;
+ return -EINVAL;
if (idx == index) {
args->adev = device;
@@ -670,13 +669,13 @@ int __acpi_node_get_property_reference(const struct fwnode_handle *fwnode,
return -ENOENT;
element++;
} else {
- return -EPROTO;
+ return -EINVAL;
}
idx++;
}
- return -ENODATA;
+ return -ENOENT;
}
EXPORT_SYMBOL_GPL(__acpi_node_get_property_reference);
diff --git a/drivers/base/property.c b/drivers/base/property.c
index d0b65bb..9c9f48b 100644
--- a/drivers/base/property.c
+++ b/drivers/base/property.c
@@ -682,6 +682,10 @@ EXPORT_SYMBOL_GPL(fwnode_property_match_string);
* Caller is responsible to call fwnode_handle_put() on the returned
* args->fwnode pointer.
*
+ * Returns: %0 on success
+ * %-ENOENT when the index is out of bounds, the index has an empty
+ * reference or the property was not found
+ * %-EINVAL on parse error
*/
int fwnode_property_get_reference_args(const struct fwnode_handle *fwnode,
const char *prop, const char *nargs_prop,