mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] of: do not acccess 'prop->value' directly
@ 2024-04-12 16:29 Enrico Scholz
  2024-04-16 11:16 ` Sascha Hauer
  0 siblings, 1 reply; 2+ messages in thread
From: Enrico Scholz @ 2024-04-12 16:29 UTC (permalink / raw)
  To: barebox; +Cc: Enrico Scholz

From: Enrico Scholz <enrico.scholz@sigma-chemnitz.de>

Use of_property_get_value() accessor.  Else, wrong results are
returned when working with fit images.

Signed-off-by: Enrico Scholz <enrico.scholz@sigma-chemnitz.de>
---
 drivers/of/base.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/of/base.c b/drivers/of/base.c
index b22959dabebf..9bd0cdaac2ad 100644
--- a/drivers/of/base.c
+++ b/drivers/of/base.c
@@ -853,7 +853,7 @@ int of_property_count_elems_of_size(const struct device_node *np,
 
 	if (!prop)
 		return -EINVAL;
-	if (!prop->value)
+	if (!of_property_get_value(prop))
 		return -ENODATA;
 
 	if (prop->length % elem_size != 0) {
@@ -2009,9 +2009,9 @@ int of_property_read_string_helper(const struct device_node *np,
 
 	if (!prop)
 		return -EINVAL;
-	if (!prop->value)
+	p = of_property_get_value(prop);
+	if (!p)
 		return -ENODATA;
-	p = prop->value;
 	end = p + prop->length;
 
 	for (i = 0; p < end && (!out_strs || i < skip + sz); i++, p += l) {
-- 
2.44.0




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

end of thread, other threads:[~2024-04-16 11:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-12 16:29 [PATCH] of: do not acccess 'prop->value' directly Enrico Scholz
2024-04-16 11:16 ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox