of/platform: Use typed accessors rather than of_get_property()
Rob Herring (Arm)
maintainerPATCH 1/1 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]>
--- drivers/of/platform.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/of/platform.c +4 -4
@@ -334,7 +334,7 @@ static int of_platform_bus_create(struct device_node *bus,int rc =0 ;/* Make sure it has a compatible property */ -if (strict && (!of_get_property (bus,"compatible" ,NULL ))) { +if (strict && (!of_property_present (bus,"compatible" ))) {pr_debug ("%s() - skipping %pOF, no compatible prop\n" , __func__, bus);return 0 ;
@@ -536,8 +536,8 @@ static int __init of_platform_default_populate_init(void)* ignore errors for the rest. */ for_each_node_by_type (node,"display" ) { -if (!of_get_property (node,"linux,opened" ,NULL ) || - !of_get_property (node,"linux,boot-display" ,NULL )) +if (!of_property_read_bool (node,"linux,opened" ) || + !of_property_read_bool (node,"linux,boot-display" ))continue ; dev =of_platform_device_create (node,"of-display" ,NULL );of_node_put (node);
@@ -551,7 +551,7 @@ static int __init of_platform_default_populate_init(void)char buf[14 ];const char *of_display_format ="of-display.%d" ; -if (!of_get_property (node,"linux,opened" ,NULL ) || node == boot_display) +if (!of_property_read_bool (node,"linux,opened" ) || node == boot_display)continue ; ret =snprintf (buf,sizeof (buf), of_display_format, display_number++);if (ret <sizeof (buf))
Signature · 1 line
2.47.2