From patchwork Tue May 13 00:29:49 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Rob Herring X-Patchwork-Id: 348184 Return-Path: X-Original-To: incoming-imx@patchwork.ozlabs.org Delivered-To: patchwork-incoming-imx@bilbo.ozlabs.org Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2001:1868:205::9]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 5D13514007E for ; Tue, 13 May 2014 10:33:36 +1000 (EST) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Wk0cZ-0000pl-BE; Tue, 13 May 2014 00:31:03 +0000 Received: from mail-oa0-x22d.google.com ([2607:f8b0:4003:c02::22d]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Wk0cA-0000Yv-Gq for linux-arm-kernel@lists.infradead.org; Tue, 13 May 2014 00:30:39 +0000 Received: by mail-oa0-f45.google.com with SMTP id l6so9060647oag.4 for ; Mon, 12 May 2014 17:30:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=UaRv1gv/0ZgXMTJvIGItKHOMmpuMOURDE1DFR+2DKhI=; b=OsrGEWBfDOojUSdK2O3+CdX1ANxhbhJmjnsJ24U4UQRJp/fjzDc054QMY3R77nuxoT wke+Yf11JBC5XHv55DgOKLkI8g0qO+Ehqym4j9sis64D29yH8X5WIW0T6Z9YQ1Cy10Ql 0wpjT1aueXUkKmbc5USC11GA5f61NsKWsSWZNbx/hl1AtqViZJEJrpGzlIKLhmXabbQt CY7Qb7zvYUXZNBW67EkSeSPDAZvshybC3cLKWgNFIKgE0iqPMCBHIZoHsHIjVKytteTg vuuKfACsFwrYx17xsZaQGtH73ZWw3PvjSzOYV1vwKUDfpIpy9+yW/8QTezC6FB4NBMEa bDmg== X-Received: by 10.182.5.65 with SMTP id q1mr83689obq.74.1399941014591; Mon, 12 May 2014 17:30:14 -0700 (PDT) Received: from localhost.localdomain (72-48-77-163.dyn.grandenetworks.net. [72.48.77.163]) by mx.google.com with ESMTPSA id ml9sm54101053oeb.2.2014.05.12.17.30.13 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 12 May 2014 17:30:14 -0700 (PDT) From: Rob Herring To: linux-kernel@vger.kernel.org, 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 Message-Id: <1399940993-1773-4-git-send-email-robherring2@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1399940993-1773-1-git-send-email-robherring2@gmail.com> References: <1399940993-1773-1-git-send-email-robherring2@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140512_173038_661055_251A1584 X-CRM114-Status: GOOD ( 11.73 ) X-Spam-Score: 0.1 (/) X-Spam-Report: SpamAssassin version 3.3.2 on bombadil.infradead.org summary: Content analysis details: (0.1 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (robherring2[at]gmail.com) 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit (robherring2[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain Cc: =?UTF-8?q?Emilio=20L=C3=B3pez?= , Rob Herring , Maxime Ripard , Mike Turquette X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org List-Id: linux-imx-kernel.lists.patchwork.ozlabs.org From: Rob Herring 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 Cc: "Emilio López" Cc: Mike Turquette Cc: Maxime Ripard Acked-by: Emilio López Tested-by: Emilio López --- 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); }