From: Michael Ellerman <mpe@ellerman.id.au>
To: Rob Herring <robh@kernel.org>,
"Rafael J. Wysocki" <rafael@kernel.org>,
Viresh Kumar <viresh.kumar@linaro.org>,
Nicholas Piggin <npiggin@gmail.com>,
Christophe Leroy <christophe.leroy@csgroup.eu>
Cc: devicetree@vger.kernel.org, linux-pm@vger.kernel.org,
linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] cpufreq: pmac32: Use of_property_read_bool() for boolean properties
Date: Thu, 16 Mar 2023 15:08:16 +1100 [thread overview]
Message-ID: <87o7otmj7z.fsf@mpe.ellerman.id.au> (raw)
In-Reply-To: <20230310144703.1541819-1-robh@kernel.org>
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
WARNING: multiple messages have this Message-ID (diff)
From: Michael Ellerman <mpe@ellerman.id.au>
To: Rob Herring <robh@kernel.org>,
"Rafael J. Wysocki" <rafael@kernel.org>,
Viresh Kumar <viresh.kumar@linaro.org>,
Nicholas Piggin <npiggin@gmail.com>,
Christophe Leroy <christophe.leroy@csgroup.eu>
Cc: devicetree@vger.kernel.org, linuxppc-dev@lists.ozlabs.org,
linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org
Subject: Re: [PATCH] cpufreq: pmac32: Use of_property_read_bool() for boolean properties
Date: Thu, 16 Mar 2023 15:08:16 +1100 [thread overview]
Message-ID: <87o7otmj7z.fsf@mpe.ellerman.id.au> (raw)
In-Reply-To: <20230310144703.1541819-1-robh@kernel.org>
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
next prev parent reply other threads:[~2023-03-16 4:08 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
2023-03-16 4:08 ` Michael Ellerman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87o7otmj7z.fsf@mpe.ellerman.id.au \
--to=mpe@ellerman.id.au \
--cc=christophe.leroy@csgroup.eu \
--cc=devicetree@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=npiggin@gmail.com \
--cc=rafael@kernel.org \
--cc=robh@kernel.org \
--cc=viresh.kumar@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.