cpufreq: pmac32: Use of_property_read_bool() for boolean properties
Subsystems (2)
PATCH 1/1 cpufreq: pmac32: Use of_property_read_bool() for boolean properties
It is preferred to use typed property access functions (i.e. of_property_read_<type> functions) rather than low-level of_get_property/of_find_property functions for reading properties. Convert reading boolean properties to to of_property_read_bool().
--- drivers/cpufreq/pmac32-cpufreq.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/cpufreq/pmac32-cpufreq.c +3 -3
@@ -546,7 +546,7 @@ static int pmac_cpufreq_init_7447A(struct device_node *cpunode) {struct device_node *volt_gpio_np; -if (of_get_property (cpunode,"dynamic-power-step" ,NULL ) ==NULL ) +if (!of_property_read_bool (cpunode,"dynamic-power-step" ))return 1 ; volt_gpio_np =of_find_node_by_name (NULL ,"cpu-vcore-select" );
@@ -576,7 +576,7 @@ static int pmac_cpufreq_init_750FX(struct device_node *cpunode)u32 pvr;const u32 *value; -if (of_get_property (cpunode,"dynamic-power-step" ,NULL ) ==NULL ) +if (!of_property_read_bool (cpunode,"dynamic-power-step" ))return 1 ; hi_freq = cur_freq;
@@ -632,7 +632,7 @@ static int __init pmac_cpufreq_setup(void)/* Check for 7447A based MacRISC3 */ if (of_machine_is_compatible ("MacRISC3" ) && -of_get_property (cpunode,"dynamic-power-step" ,NULL ) && +of_property_read_bool (cpunode,"dynamic-power-step" ) &&PVR_VER (mfspr (SPRN_PVR )) ==0x8003 ) {pmac_cpufreq_init_7447A (cpunode);
Signature · 1 line
2.39.2
Quoted 9 lines · Rob Herring
It is preferred to use typed property access functions (i.e. of_property_read_<type> functions) rather than low-level of_get_property/of_find_property functions for reading properties. Convert reading boolean properties to to
of_property_read_bool().Signed-off-by Rob Herring <[email protected]>--- drivers/cpufreq/pmac32-cpufreq.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
Signature · 1 line
viresh
Quoted 7 lines · Viresh Kumar
Quoted 5 lines · Rob Herring
It is preferred to use typed property access functions (i.e. of_property_read_<type> functions) rather than low-level of_get_property/of_find_property functions for reading properties. Convert reading boolean properties to to
of_property_read_bool().
Quoted 6 lines
Quoted 4 lines
Signed-off-by Rob Herring <[email protected]>--- drivers/cpufreq/pmac32-cpufreq.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)Acked-by Viresh Kumar <[email protected]>
Applied as 6.4 material, thanks!
Quoted 9 lines · Rob Herring
It is preferred to use typed property access functions (i.e. of_property_read_<type> functions) rather than low-level of_get_property/of_find_property functions for reading properties. Convert reading boolean properties to to
of_property_read_bool().Signed-off-by Rob Herring <[email protected]>--- drivers/cpufreq/pmac32-cpufreq.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
cheers
Quoted 33 lines
drivers/cpufreq/pmac32-cpufreq.c +3
-3@@ -546,7 +546,7 @@ static int pmac_cpufreq_init_7447A(struct device_node *cpunode) {struct device_node *volt_gpio_np; -if (of_get_property (cpunode,"dynamic-power-step" ,NULL ) ==NULL ) +if (!of_property_read_bool (cpunode,"dynamic-power-step" ))return 1 ; volt_gpio_np =of_find_node_by_name (NULL ,"cpu-vcore-select" );@@ -576,7 +576,7 @@ static int pmac_cpufreq_init_750FX(struct device_node *cpunode)u32 pvr;const u32 *value; -if (of_get_property (cpunode,"dynamic-power-step" ,NULL ) ==NULL ) +if (!of_property_read_bool (cpunode,"dynamic-power-step" ))return 1 ; hi_freq = cur_freq;@@ -632,7 +632,7 @@ static int __init pmac_cpufreq_setup(void)/* Check for 7447A based MacRISC3 */ if (of_machine_is_compatible ("MacRISC3" ) && -of_get_property (cpunode,"dynamic-power-step" ,NULL ) && +of_property_read_bool (cpunode,"dynamic-power-step" ) &&PVR_VER (mfspr (SPRN_PVR )) ==0x8003 ) {pmac_cpufreq_init_7447A (cpunode);Signature · 1 line
2.39.2