[PATCH 3/3] OF: base: add empty property value pointer

Sebastian Hesselbarth sebastian.hesselbarth at gmail.com
Sun Jun 23 16:29:23 EDT 2013

On 06/23/2013 10:26 PM, Sascha Hauer wrote:
> On Sun, Jun 23, 2013 at 10:11:39PM +0200, Sebastian Hesselbarth wrote:
>> On 06/23/2013 08:33 PM, Sascha Hauer wrote:
>>> Why do we need this anyway? We can always call of_find_property() to see
>>> if a property exists.
>> Actually, I was preparing to import drivers/of/address.c from linux.
>> of_translate_one uses of_get_property on "ranges". This returns
>> the property's value pointer instead of the property itself, which
>> is NULL for an empty ranges property. Now that you point it out,
>> using of_find_property is also an option.
>> Nevertheless, patches 1 (with your comments applied) and 2 seem
>> sensible to me. Patch 3 is an option to keep it in sync with Linux
>> OF API behavior but is optional.
> How about allocating zero length property values with malloc(0)? This
> makes them less special.

Agree, I will update the patch set and send a v2 hopefully soon.


More information about the barebox mailing list