driver core: property: Update fwnode_property_read_string_array()
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Mon, 23 Mar 2015 23:18:05 +0000 (00:18 +0100)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Wed, 25 Mar 2015 19:59:09 +0000 (20:59 +0100)
Commit 5c0acf3b4f96 (driver core: Add comments about returning array
counts) forgot to update fwnode_property_read_string_array() along
the lines of device_property_read_string_array(), although it did
change the kerneldoc comment of it.  Fix that.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/base/property.c

index b524a4e42a8338eb56a05160017f7b5ce88cc007..cf3b2160e34ecc964b327dd492587966a2a48ce4 100644 (file)
@@ -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);