summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--drivers/base/property.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/base/property.c b/drivers/base/property.c
index b524a4e42a83..cf3b2160e34e 100644
--- a/drivers/base/property.c
+++ b/drivers/base/property.c
@@ -347,8 +347,10 @@ int fwnode_property_read_string_array(struct fwnode_handle *fwnode,
size_t nval)
{
if (is_of_node(fwnode))
- return of_property_read_string_array(of_node(fwnode), propname,
- val, nval);
+ return val ?
+ of_property_read_string_array(of_node(fwnode), propname,
+ val, nval) :
+ of_property_count_strings(of_node(fwnode), propname);
else if (is_acpi_node(fwnode))
return acpi_dev_prop_read(acpi_node(fwnode), propname,
DEV_PROP_STRING, val, nval);