[PATCH 1/2] of: add support for value "false" to of_property_read_bool

Josua Mayer josua at solid-run.com
Mon Nov 11 22:52:13 PST 2024


Am 12.11.24 um 08:41 schrieb Josua Mayer:
> Boolean type properties are usually considered true if present and false
> when they do not exist. This works well for many in-tree board dts and
> existing drivers.
>
> When users need to overrride boolean values from included dts includes,
> /delete-property/ is recommend. This however does not work in overlays
> (addons).
>
> Several places use string "true" ([1], [2], [3]) and one uses string
> "false" ([1]). This suggests that at some point the value of a type
> string property was to be taken into account during evaluation.
>
> Change of_property_read_bool to only return true if a property is both
> present, and not equal "false".
>
> Existing usage in drivers/of and include/linux/of.h are updated
> accordingly.
> Other places should be reviewed as needed wrt. changed semantics.
>
> [1] Documentation/devicetree/bindings/sound/rt5651.txt
> [2] Documentation/devicetree/bindings/sound/pcm3060.txt
> [3] arch/arm/boot/dts/ti/omap/am335x-baltos.dtsi
>
> Signed-off-by: Josua Mayer <josua at solid-run.com>
> ---
Please note this patch-set has only been tested to compile,
I do not consider it ready for current merge window.

I would however appreciate comments.



More information about the linux-arm-kernel mailing list