All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] cpufreq: pmac32: Use of_property_read_bool() for boolean properties
@ 2023-03-10 14:47 ` Rob Herring
  0 siblings, 0 replies; 8+ messages in thread
From: Rob Herring @ 2023-03-10 14:47 UTC (permalink / raw)
  To: Rafael J. Wysocki, Viresh Kumar, Michael Ellerman,
	Nicholas Piggin, Christophe Leroy
  Cc: devicetree, linux-pm, linuxppc-dev, linux-kernel

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 <robh@kernel.org>
---
 drivers/cpufreq/pmac32-cpufreq.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/cpufreq/pmac32-cpufreq.c b/drivers/cpufreq/pmac32-cpufreq.c
index 4b8ee2014da6..7ec6d1bb4592 100644
--- a/drivers/cpufreq/pmac32-cpufreq.c
+++ b/drivers/cpufreq/pmac32-cpufreq.c
@@ -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);
 
-- 
2.39.2


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

* [PATCH] cpufreq: pmac32: Use of_property_read_bool() for boolean properties
@ 2023-03-10 14:47 ` Rob Herring
  0 siblings, 0 replies; 8+ messages in thread
From: Rob Herring @ 2023-03-10 14:47 UTC (permalink / raw)
  To: Rafael J. Wysocki, Viresh Kumar, Michael Ellerman,
	Nicholas Piggin, Christophe Leroy
  Cc: devicetree, linuxppc-dev, linux-kernel, linux-pm

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 <robh@kernel.org>
---
 drivers/cpufreq/pmac32-cpufreq.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/cpufreq/pmac32-cpufreq.c b/drivers/cpufreq/pmac32-cpufreq.c
index 4b8ee2014da6..7ec6d1bb4592 100644
--- a/drivers/cpufreq/pmac32-cpufreq.c
+++ b/drivers/cpufreq/pmac32-cpufreq.c
@@ -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);
 
-- 
2.39.2


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

* Re: [PATCH] cpufreq: pmac32: Use of_property_read_bool() for boolean properties
  2023-03-10 14:47 ` Rob Herring
@ 2023-03-13  4:26   ` Viresh Kumar
  -1 siblings, 0 replies; 8+ messages in thread
From: Viresh Kumar @ 2023-03-13  4:26 UTC (permalink / raw)
  To: Rob Herring
  Cc: Rafael J. Wysocki, Michael Ellerman, Nicholas Piggin,
	Christophe Leroy, devicetree, linux-pm, linuxppc-dev,
	linux-kernel

On 10-03-23, 08:47, Rob Herring wrote:
> 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 <robh@kernel.org>
> ---
>  drivers/cpufreq/pmac32-cpufreq.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)

Acked-by: Viresh Kumar <viresh.kumar@linaro.org>

-- 
viresh

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

* Re: [PATCH] cpufreq: pmac32: Use of_property_read_bool() for boolean properties
@ 2023-03-13  4:26   ` Viresh Kumar
  0 siblings, 0 replies; 8+ messages in thread
From: Viresh Kumar @ 2023-03-13  4:26 UTC (permalink / raw)
  To: Rob Herring
  Cc: devicetree, linux-pm, Rafael J. Wysocki, linux-kernel,
	Nicholas Piggin, linuxppc-dev

On 10-03-23, 08:47, Rob Herring wrote:
> 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 <robh@kernel.org>
> ---
>  drivers/cpufreq/pmac32-cpufreq.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)

Acked-by: Viresh Kumar <viresh.kumar@linaro.org>

-- 
viresh

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

* Re: [PATCH] cpufreq: pmac32: Use of_property_read_bool() for boolean properties
  2023-03-10 14:47 ` Rob Herring
@ 2023-03-16  4:08   ` Michael Ellerman
  -1 siblings, 0 replies; 8+ messages in thread
From: Michael Ellerman @ 2023-03-16  4:08 UTC (permalink / raw)
  To: Rob Herring, Rafael J. Wysocki, Viresh Kumar, Nicholas Piggin,
	Christophe Leroy
  Cc: devicetree, linux-pm, linuxppc-dev, linux-kernel

Rob Herring <robh@kernel.org> writes:
> 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 <robh@kernel.org>
> ---
>  drivers/cpufreq/pmac32-cpufreq.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)

Reviewed-by: Michael Ellerman <mpe@ellerman.id.au>

cheers

> diff --git a/drivers/cpufreq/pmac32-cpufreq.c b/drivers/cpufreq/pmac32-cpufreq.c
> index 4b8ee2014da6..7ec6d1bb4592 100644
> --- a/drivers/cpufreq/pmac32-cpufreq.c
> +++ b/drivers/cpufreq/pmac32-cpufreq.c
> @@ -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);
>  
> -- 
> 2.39.2

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

* Re: [PATCH] cpufreq: pmac32: Use of_property_read_bool() for boolean properties
@ 2023-03-16  4:08   ` Michael Ellerman
  0 siblings, 0 replies; 8+ messages in thread
From: Michael Ellerman @ 2023-03-16  4:08 UTC (permalink / raw)
  To: Rob Herring, Rafael J. Wysocki, Viresh Kumar, Nicholas Piggin,
	Christophe Leroy
  Cc: devicetree, linuxppc-dev, linux-kernel, linux-pm

Rob Herring <robh@kernel.org> writes:
> 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 <robh@kernel.org>
> ---
>  drivers/cpufreq/pmac32-cpufreq.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)

Reviewed-by: Michael Ellerman <mpe@ellerman.id.au>

cheers

> diff --git a/drivers/cpufreq/pmac32-cpufreq.c b/drivers/cpufreq/pmac32-cpufreq.c
> index 4b8ee2014da6..7ec6d1bb4592 100644
> --- a/drivers/cpufreq/pmac32-cpufreq.c
> +++ b/drivers/cpufreq/pmac32-cpufreq.c
> @@ -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);
>  
> -- 
> 2.39.2

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

* Re: [PATCH] cpufreq: pmac32: Use of_property_read_bool() for boolean properties
  2023-03-13  4:26   ` Viresh Kumar
@ 2023-03-27 17:11     ` Rafael J. Wysocki
  -1 siblings, 0 replies; 8+ messages in thread
From: Rafael J. Wysocki @ 2023-03-27 17:11 UTC (permalink / raw)
  To: Viresh Kumar, Rob Herring
  Cc: Rafael J. Wysocki, Michael Ellerman, Nicholas Piggin,
	Christophe Leroy, devicetree, linux-pm, linuxppc-dev,
	linux-kernel

On Mon, Mar 13, 2023 at 5:26 AM Viresh Kumar <viresh.kumar@linaro.org> wrote:
>
> On 10-03-23, 08:47, Rob Herring wrote:
> > 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 <robh@kernel.org>
> > ---
> >  drivers/cpufreq/pmac32-cpufreq.c | 6 +++---
> >  1 file changed, 3 insertions(+), 3 deletions(-)
>
> Acked-by: Viresh Kumar <viresh.kumar@linaro.org>

Applied as 6.4 material, thanks!

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

* Re: [PATCH] cpufreq: pmac32: Use of_property_read_bool() for boolean properties
@ 2023-03-27 17:11     ` Rafael J. Wysocki
  0 siblings, 0 replies; 8+ messages in thread
From: Rafael J. Wysocki @ 2023-03-27 17:11 UTC (permalink / raw)
  To: Viresh Kumar, Rob Herring
  Cc: devicetree, linux-pm, Rafael J. Wysocki, linux-kernel,
	Nicholas Piggin, linuxppc-dev

On Mon, Mar 13, 2023 at 5:26 AM Viresh Kumar <viresh.kumar@linaro.org> wrote:
>
> On 10-03-23, 08:47, Rob Herring wrote:
> > 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 <robh@kernel.org>
> > ---
> >  drivers/cpufreq/pmac32-cpufreq.c | 6 +++---
> >  1 file changed, 3 insertions(+), 3 deletions(-)
>
> Acked-by: Viresh Kumar <viresh.kumar@linaro.org>

Applied as 6.4 material, thanks!

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

end of thread, other threads:[~2023-03-27 17:12 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-10 14:47 [PATCH] cpufreq: pmac32: Use of_property_read_bool() for boolean properties Rob Herring
2023-03-10 14:47 ` Rob Herring
2023-03-13  4:26 ` Viresh Kumar
2023-03-13  4:26   ` Viresh Kumar
2023-03-27 17:11   ` Rafael J. Wysocki
2023-03-27 17:11     ` Rafael J. Wysocki
2023-03-16  4:08 ` Michael Ellerman
2023-03-16  4:08   ` Michael Ellerman

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.