[RFC/PATCH 2/2] of: allow for boolean flags to have value

Arnd Bergmann arnd at arndb.de
Thu Feb 5 10:16:47 PST 2015


On Thursday 05 February 2015 12:01:06 Felipe Balbi wrote:
> +       /*
> +        * if property doesn't have a value, or prop->length == 0 and
> +        * we overflow, treat it as simple value-less flag.
> +        */
> +       if (rc == -ENODATA || rc == -EOVERFLOW)
> +               return true;
> +       if (WARN(rc < 0, "failed to read '%s' value -> %d\n",
> +                               propname, rc))
> +               return false;
> 

I think there are drivers today that use of_property_read_bool()
to check for the presence of a property that is not already empty.
If the property starts with a zero cell, that would break here.

	Arnd



More information about the linux-arm-kernel mailing list