Skip to content

device property: Warn on (of|fwnode|device)_property_read_bool() for non-boolean properties

Rob Herring (Arm) linux-acpi linux-arm-kernel linux-devicetree linux-renesas-soc lkml 1 version In review

Get series with b4
b4 am [email protected] change-id 20250109-dt-type-warnings-efe52d977bb2

Versions newest first

  1. v1 Latest2 patches 11 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2device property: Split property reading bool and presence test opsdrivers/acpi/property.c drivers/base/property.c drivers/base/swnode.c +4 more+56 -134 replies
2/2of: Warn when of_property_read_bool() is used on non-boolean propertiesdrivers/of/property.c include/linux/of.h+33 -186 replies

Reviews trailers per patch

All 2 patches have a Reviewed-by or Acked-by.

PatchGreg Kroah-HartmanKrzysztof KozlowskiRafael J. WysockiSakari Ailus
1/2A-b R-b A-b R-b
2/2R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 4 reviewers.

Read the v1 thread

Cover letter [PATCH 0/2] device property: Warn on (of|fwnode|device)_property_read_bool() for non-boolean properties

This series makes using (of|fwnode|device)_property_read_bool() on non-boolean properties give a warning when used with DT. This has been deprecated behavior for a while now. Soon we will add yet another variant of this function with a Rust binding[1].

Why not put the warning in the fwnode code? The fwnode code doesn't know the property's type as that depends on the firmware. For DT, a boolean is a property with no value.

Perhaps the ACPI backend should have a warning too? I looked briefly at it, but I don't have a clue how or if that can be detected. Doesn't look like there's a specific type for booleans. In any case, that would be an additional change on top of this series.

[1] https://lore.kernel.org/all/[email protected]/

---
Rob Herring (Arm) (2):
device property: Split property reading bool and presence test ops
of: Warn when of_property_read_bool() is used on non-boolean properties

 drivers/acpi/property.c  |  1 +
 drivers/base/property.c  | 38 ++++++++++++++++++++++++++++++++++++++
 drivers/base/swnode.c    |  1 +
 drivers/of/property.c    | 33 +++++++++++++++++++++++++++++++++
 include/linux/fwnode.h   |  3 +++
 include/linux/of.h       | 29 ++++++++++-------------------
 include/linux/property.h | 15 +++------------
 7 files changed, 89 insertions(+), 31 deletions(-)

---
base-commit: 40384c840ea1944d7c5a392e8975ed088ecf0b37
change-id: 20250109-dt-type-warnings-efe52d977bb2

Best regards,

Signature · 1 line
Rob Herring (Arm) <[email protected]>