Skip to content

Commit

Permalink
driver core: property: Update fwnode_property_read_string_array()
Browse files Browse the repository at this point in the history
Commit 5c0acf3 (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>
  • Loading branch information
Rafael J. Wysocki committed Mar 25, 2015
1 parent 5c0acf3 commit f42712a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/base/property.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit f42712a

Please sign in to comment.