Skip to content

Commit ea265e4

Browse files
robherringmiquelraynal
authored andcommitted
mtd: Use of_property_read_bool()
Use of_property_read_bool() to read boolean properties rather than of_get_property(). This is part of a larger effort to remove callers of of_get_property() and similar functions. of_get_property() leaks the DT property data pointer which is a problem for dynamically allocated nodes which may be freed. Signed-off-by: Rob Herring (Arm) <[email protected]> Signed-off-by: Miquel Raynal <[email protected]> Link: https://lore.kernel.org/linux-mtd/[email protected]
1 parent 336c218 commit ea265e4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/mtd/parsers/ofpart_core.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,10 +157,10 @@ static int parse_fixed_partitions(struct mtd_info *master,
157157
partname = of_get_property(pp, "name", &len);
158158
parts[i].name = partname;
159159

160-
if (of_get_property(pp, "read-only", &len))
160+
if (of_property_read_bool(pp, "read-only"))
161161
parts[i].mask_flags |= MTD_WRITEABLE;
162162

163-
if (of_get_property(pp, "lock", &len))
163+
if (of_property_read_bool(pp, "lock"))
164164
parts[i].mask_flags |= MTD_POWERUP_LOCK;
165165

166166
if (of_property_read_bool(pp, "slc-mode"))

0 commit comments

Comments
 (0)