devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] device property: Warn on (of|fwnode|device)_property_read_bool() for non-boolean properties
@ 2025-01-09 19:42 Rob Herring (Arm)
  2025-01-09 19:42 ` [PATCH 1/2] device property: Split property reading bool and presence test ops Rob Herring (Arm)
                   ` (2 more replies)
  0 siblings, 3 replies; 14+ messages in thread
From: Rob Herring (Arm) @ 2025-01-09 19:42 UTC (permalink / raw)
  To: Rafael J. Wysocki, Len Brown, Andy Shevchenko, Daniel Scally,
	Heikki Krogerus, Sakari Ailus, Greg Kroah-Hartman,
	Danilo Krummrich, Saravana Kannan
  Cc: linux-acpi, linux-kernel, devicetree

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/20241025-rust-platform-dev-v1-2-0df8dcf7c20b@kernel.org/

Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
---
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,
-- 
Rob Herring (Arm) <robh@kernel.org>


^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2025-03-10 13:16 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-09 19:42 [PATCH 0/2] device property: Warn on (of|fwnode|device)_property_read_bool() for non-boolean properties Rob Herring (Arm)
2025-01-09 19:42 ` [PATCH 1/2] device property: Split property reading bool and presence test ops Rob Herring (Arm)
2025-01-10 15:05   ` Greg Kroah-Hartman
2025-01-11 10:14   ` Krzysztof Kozlowski
2025-01-13 19:06   ` Rafael J. Wysocki
2025-01-15  7:23   ` Sakari Ailus
2025-01-09 19:42 ` [PATCH 2/2] of: Warn when of_property_read_bool() is used on non-boolean properties Rob Herring (Arm)
2025-01-11 10:12   ` Krzysztof Kozlowski
2025-01-14 18:35   ` Geert Uytterhoeven
2025-01-14 19:10     ` Andy Shevchenko
2025-01-14 19:19     ` Rob Herring
2025-01-15 11:20       ` Geert Uytterhoeven
2025-03-10 13:15         ` Geert Uytterhoeven
2025-01-13  8:58 ` [PATCH 0/2] device property: Warn on (of|fwnode|device)_property_read_bool() for " Andy Shevchenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).