Re: [PATCH 3/3] device property: of_property_read_string_array() returns number of strings

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

 




Hi Rafael,

On 03/14/17 00:24, Rafael J. Wysocki wrote:
> On Monday, March 06, 2017 03:26:31 PM Sakari Ailus wrote:
>> of_property_read_string_array() returns number of strings read if the
>> target array of pointers is non-NULL. fwnode_property_read_string_array()
>> is documented to return 0 in that case. Fix this.
> 
> Well, if we want people to use fwnode_property_read_string_array() instead of
> of_property_read_string_array(), it should better behave analogously, shouldn't it?

Not necessarily.

The documentation states that fwnode_property_read_string_array()
returns 0 on success. That makes sense since the callers often check
whether the return value is non-zero and then return based on that.
Returning zero on success is just simpler for the caller.

Often the number of elements to read from an array is known beforehand,
so there's little use for the actual number read.

Besides the fwnode variants, also the OF integer array access functions
return zero on success.

Rob had a similar comment but the discussion did not continue after my
initial reply. I can sure change that if you still think it's better the
other way.

-- 
Kind regards,

Sakari Ailus
sakari.ailus@xxxxxxxxxxxxxxx
--
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