diff mbox

[8/8] cpufreq: ppc: make use of of_find_matching_node_and_match

Message ID 1392135847-30791-9-git-send-email-joshc@codeaurora.org (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Josh Cartwright Feb. 11, 2014, 4:24 p.m. UTC
Instead of the of_find_matching_node()/of_match_node() pair, which requires two
iterations through the match table, make use of of_find_matching_node_and_match(),
which only iterates through the table once.

Signed-off-by: Josh Cartwright <joshc@codeaurora.org>
---
 drivers/cpufreq/ppc-corenet-cpufreq.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Viresh Kumar Feb. 12, 2014, 5:01 a.m. UTC | #1
On 11 February 2014 21:54, Josh Cartwright <joshc@codeaurora.org> wrote:
> Instead of the of_find_matching_node()/of_match_node() pair, which requires two
> iterations through the match table, make use of of_find_matching_node_and_match(),
> which only iterates through the table once.
>
> Signed-off-by: Josh Cartwright <joshc@codeaurora.org>
> ---
>  drivers/cpufreq/ppc-corenet-cpufreq.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/cpufreq/ppc-corenet-cpufreq.c b/drivers/cpufreq/ppc-corenet-cpufreq.c
> index 051000f..041ef3a 100644
> --- a/drivers/cpufreq/ppc-corenet-cpufreq.c
> +++ b/drivers/cpufreq/ppc-corenet-cpufreq.c
> @@ -278,7 +278,7 @@ static int __init ppc_corenet_cpufreq_init(void)
>         const struct soc_data *data;
>         unsigned int cpu;
>
> -       np = of_find_matching_node(NULL, node_matches);
> +       np = of_find_matching_node_and_match(NULL, node_matches, &match);
>         if (!np)
>                 return -ENODEV;
>
> @@ -288,7 +288,6 @@ static int __init ppc_corenet_cpufreq_init(void)
>                 cpumask_copy(per_cpu(cpu_mask, cpu), cpu_core_mask(cpu));
>         }
>
> -       match = of_match_node(node_matches, np);
>         data = match->data;
>         if (data) {
>                 if (data->flag)

Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
--
To unsubscribe from this list: send the line "unsubscribe linux-pm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/cpufreq/ppc-corenet-cpufreq.c b/drivers/cpufreq/ppc-corenet-cpufreq.c
index 051000f..041ef3a 100644
--- a/drivers/cpufreq/ppc-corenet-cpufreq.c
+++ b/drivers/cpufreq/ppc-corenet-cpufreq.c
@@ -278,7 +278,7 @@  static int __init ppc_corenet_cpufreq_init(void)
 	const struct soc_data *data;
 	unsigned int cpu;
 
-	np = of_find_matching_node(NULL, node_matches);
+	np = of_find_matching_node_and_match(NULL, node_matches, &match);
 	if (!np)
 		return -ENODEV;
 
@@ -288,7 +288,6 @@  static int __init ppc_corenet_cpufreq_init(void)
 		cpumask_copy(per_cpu(cpu_mask, cpu), cpu_core_mask(cpu));
 	}
 
-	match = of_match_node(node_matches, np);
 	data = match->data;
 	if (data) {
 		if (data->flag)