Skip to content

Commit 3367838

Browse files
committed
of/platform: Use typed accessors rather than of_get_property()
Use the typed of_property_* functions rather than of_get_property() which leaks pointers to DT data without any control of the lifetime. Signed-off-by: "Rob Herring (Arm)" <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Rob Herring (Arm) <[email protected]>
1 parent 10e6168 commit 3367838

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/of/platform.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -536,8 +536,8 @@ static int __init of_platform_default_populate_init(void)
536536
* ignore errors for the rest.
537537
*/
538538
for_each_node_by_type(node, "display") {
539-
if (!of_get_property(node, "linux,opened", NULL) ||
540-
!of_get_property(node, "linux,boot-display", NULL))
539+
if (!of_property_read_bool(node, "linux,opened") ||
540+
!of_property_read_bool(node, "linux,boot-display"))
541541
continue;
542542
dev = of_platform_device_create(node, "of-display", NULL);
543543
of_node_put(node);
@@ -551,7 +551,7 @@ static int __init of_platform_default_populate_init(void)
551551
char buf[14];
552552
const char *of_display_format = "of-display.%d";
553553

554-
if (!of_get_property(node, "linux,opened", NULL) || node == boot_display)
554+
if (!of_property_read_bool(node, "linux,opened") || node == boot_display)
555555
continue;
556556
ret = snprintf(buf, sizeof(buf), of_display_format, display_number++);
557557
if (ret < sizeof(buf))

0 commit comments

Comments
 (0)