[RFC 4/5] ACPI: align acpi_fwnode_get_reference_args with OF counterpart

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




acpi_fwnode_get_reference_args currently returns -EINVAL if a property
isn't found. -EINVAL is returned on parse error as well, and a
non-existent property is, for a list of references with arguments, usually
effectively the same as a property without entries.

Thus use -ENODATA to signal this as well. -EINVAL is still used to tell
about parse errors.

Signed-off-by: Sakari Ailus <sakari.ailus@xxxxxxxxxxxxxxx>
---
 drivers/acpi/property.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/acpi/property.c b/drivers/acpi/property.c
index c1c216163de3..c6c777341023 100644
--- a/drivers/acpi/property.c
+++ b/drivers/acpi/property.c
@@ -1211,6 +1211,9 @@ acpi_fwnode_get_reference_args(const struct fwnode_handle *fwnode,
 	unsigned int i;
 	int ret;
 
+	if (acpi_node_prop_get(fwnode, prop, NULL))
+		return -ENODATA;
+
 	ret = __acpi_node_get_property_reference(fwnode, prop, index,
 						 args_count, &acpi_args);
 	if (ret < 0)
-- 
2.11.0

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux