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: 4161841 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 5DE9D9F1C0 for ; Tue, 13 May 2014 00:33:23 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8734320222 for ; Tue, 13 May 2014 00:33:22 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B2696201F5 for ; Tue, 13 May 2014 00:33:21 +0000 (UTC) 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 (/) 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-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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); }