All of lore.kernel.org
 help / color / mirror / Atom feed
From: robherring2@gmail.com (Rob Herring)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 3/7] clk: sunxi: avoid double DT matching
Date: Mon, 12 May 2014 19:29:49 -0500	[thread overview]
Message-ID: <1399940993-1773-4-git-send-email-robherring2@gmail.com> (raw)
In-Reply-To: <1399940993-1773-1-git-send-email-robherring2@gmail.com>

From: Rob Herring <robh@kernel.org>

Use for_each_matching_node_and_match instead of for_each_matching_node plus
of_match_node to avoid searching the DT twice for each node.

The sunxi DT scanning code should really be re-worked rather than have
its own private matching infrastructure. It is working around needing a
function pointer and a data pointer for each compatible match.

Signed-off-by: Rob Herring <robh@kernel.org>
Cc: "Emilio L?pez" <emilio@elopez.com.ar>
Cc: Mike Turquette <mturquette@linaro.org>
Cc: Maxime Ripard <maxime.ripard@free-electrons.com>
---
 drivers/clk/sunxi/clk-sunxi.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/clk/sunxi/clk-sunxi.c b/drivers/clk/sunxi/clk-sunxi.c
index bd7dc73..7977106 100644
--- a/drivers/clk/sunxi/clk-sunxi.c
+++ b/drivers/clk/sunxi/clk-sunxi.c
@@ -1278,8 +1278,7 @@ static void __init of_sunxi_table_clock_setup(const struct of_device_id *clk_mat
 	const struct of_device_id *match;
 	void (*setup_function)(struct device_node *, const void *) = function;
 
-	for_each_matching_node(np, clk_match) {
-		match = of_match_node(clk_match, np);
+	for_each_matching_node_and_match(np, clk_match, match) {
 		data = match->data;
 		setup_function(np, data);
 	}
-- 
1.9.1

WARNING: multiple messages have this Message-ID (diff)
From: Rob Herring <robherring2@gmail.com>
To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org
Cc: "Rob Herring" <robh@kernel.org>,
	"Emilio López" <emilio@elopez.com.ar>,
	"Mike Turquette" <mturquette@linaro.org>,
	"Maxime Ripard" <maxime.ripard@free-electrons.com>
Subject: [PATCH 3/7] clk: sunxi: avoid double DT matching
Date: Mon, 12 May 2014 19:29:49 -0500	[thread overview]
Message-ID: <1399940993-1773-4-git-send-email-robherring2@gmail.com> (raw)
In-Reply-To: <1399940993-1773-1-git-send-email-robherring2@gmail.com>

From: Rob Herring <robh@kernel.org>

Use for_each_matching_node_and_match instead of for_each_matching_node plus
of_match_node to avoid searching the DT twice for each node.

The sunxi DT scanning code should really be re-worked rather than have
its own private matching infrastructure. It is working around needing a
function pointer and a data pointer for each compatible match.

Signed-off-by: Rob Herring <robh@kernel.org>
Cc: "Emilio López" <emilio@elopez.com.ar>
Cc: Mike Turquette <mturquette@linaro.org>
Cc: Maxime Ripard <maxime.ripard@free-electrons.com>
---
 drivers/clk/sunxi/clk-sunxi.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/clk/sunxi/clk-sunxi.c b/drivers/clk/sunxi/clk-sunxi.c
index bd7dc73..7977106 100644
--- a/drivers/clk/sunxi/clk-sunxi.c
+++ b/drivers/clk/sunxi/clk-sunxi.c
@@ -1278,8 +1278,7 @@ static void __init of_sunxi_table_clock_setup(const struct of_device_id *clk_mat
 	const struct of_device_id *match;
 	void (*setup_function)(struct device_node *, const void *) = function;
 
-	for_each_matching_node(np, clk_match) {
-		match = of_match_node(clk_match, np);
+	for_each_matching_node_and_match(np, clk_match, match) {
 		data = match->data;
 		setup_function(np, data);
 	}
-- 
1.9.1


  parent reply	other threads:[~2014-05-13  0:29 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-13  0:29 [PATCH 0/7] OF init section function prototype fixes Rob Herring
2014-05-13  0:29 ` Rob Herring
2014-05-13  0:29 ` [PATCH 1/7] ARM: imx: fix function type for CLK_OF_DECLARE Rob Herring
2014-05-13  0:29   ` Rob Herring
2014-05-13  2:10   ` Shawn Guo
2014-05-13  2:10     ` Shawn Guo
2014-05-13  0:29 ` [PATCH 2/7] clk: rockchip: " Rob Herring
2014-05-13  0:29   ` Rob Herring
2014-05-13  0:29 ` Rob Herring [this message]
2014-05-13  0:29   ` [PATCH 3/7] clk: sunxi: avoid double DT matching Rob Herring
2014-05-13 15:12   ` Rob Herring
2014-05-13 15:12     ` Rob Herring
2014-05-13 16:57     ` Emilio López
2014-05-13 16:57       ` Emilio López
2014-05-13  0:29 ` [PATCH 4/7] clk: sunxi: fix function type for CLK_OF_DECLARE Rob Herring
2014-05-13  0:29   ` Rob Herring
2014-05-13  0:29 ` [PATCH 5/7] irqchip: s3c24xx: fix function type for IRQCHIP_OF_DECLARE Rob Herring
2014-05-13  0:29   ` Rob Herring
2014-05-13 15:22   ` Jason Cooper
2014-05-13 15:22     ` Jason Cooper
2014-05-13 17:02     ` Rob Herring
2014-05-13 17:02       ` Rob Herring
2014-05-13 19:19       ` Jason Cooper
2014-05-13 19:19         ` Jason Cooper
2014-05-13  0:29 ` [PATCH 6/7] irqchip: mxs: " Rob Herring
2014-05-13  0:29   ` Rob Herring
2014-05-13  0:29 ` [PATCH 7/7] clk: ti: add missing semi-colon on CLK_OF_DECLARE Rob Herring
2014-05-13  0:29   ` Rob Herring

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=1399940993-1773-4-git-send-email-robherring2@gmail.com \
    --to=robherring2@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.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.