Skip to contentSkip to conversation

ACPI: property: Always return -ENOENT if there are no more references

PATCH New Sakari Ailus 1 participant 1 message Feb 25, 2022 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

PATCH v3 1/18 ACPI: property: Always return -ENOENT if there are no more references

__acpi_node_get_property_reference() is documented to return -ENOENT if the caller requests a property reference at an index that does not exist, not -EINVAL which it actually does.

Fix this by returning -ENOENT consistenly, independently of whether the property value is a plain reference or a package.

Fixes c343bc2ce2c6 ("ACPI: properties: Align return codes of __acpi_node_get_property_reference()")
---
 drivers/acpi/property.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/acpi/property.c +1 -1
index d0986bda29640..3fceb4681ec9f 100644
@@ -685,7 +685,7 @@ int __acpi_node_get_property_reference(const struct fwnode_handle *fwnode,
 	 */
 	if (obj->type == ACPI_TYPE_LOCAL_REFERENCE) {
 		if (index)
-			return -EINVAL;
+			return -ENOENT;
 
 		device = acpi_fetch_acpi_dev(obj->reference.handle);
 		if (!device)
Signature · 1 line
2.30.2