From patchwork Mon Mar 7 16:22:12 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shawn Guo X-Patchwork-Id: 409 Return-Path: Delivered-To: unknown Received: from imap.gmail.com (74.125.159.109) by localhost6.localdomain6 with IMAP4-SSL; 08 Jun 2011 14:42:26 -0000 Delivered-To: patches@linaro.org Received: by 10.224.60.68 with SMTP id o4cs107071qah; Mon, 7 Mar 2011 08:20:44 -0800 (PST) Received: by 10.224.103.213 with SMTP id l21mr3350953qao.98.1299514844672; Mon, 07 Mar 2011 08:20:44 -0800 (PST) Received: from mail-pw0-f50.google.com (mail-pw0-f50.google.com [209.85.160.50]) by mx.google.com with ESMTPS id n14si2442840vcs.43.2011.03.07.08.20.44 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 07 Mar 2011 08:20:44 -0800 (PST) Received-SPF: neutral (google.com: 209.85.160.50 is neither permitted nor denied by best guess record for domain of shawn.guo@linaro.org) client-ip=209.85.160.50; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.160.50 is neither permitted nor denied by best guess record for domain of shawn.guo@linaro.org) smtp.mail=shawn.guo@linaro.org Received: by pwi3 with SMTP id 3so1164863pwi.37 for ; Mon, 07 Mar 2011 08:20:43 -0800 (PST) Received: by 10.142.149.21 with SMTP id w21mr3465168wfd.431.1299514843379; Mon, 07 Mar 2011 08:20:43 -0800 (PST) Received: from localhost.localdomain ([114.216.147.253]) by mx.google.com with ESMTPS id w11sm4629111wfh.6.2011.03.07.08.20.39 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 07 Mar 2011 08:20:42 -0800 (PST) From: Shawn Guo To: linaro-dev@lists.linaro.org, devicetree-discuss@lists.ozlabs.org Cc: patches@linaro.org, Shawn Guo Subject: [PATCH 5/5] of/clock: eliminate function __of_clk_get_from_provider Date: Tue, 8 Mar 2011 00:22:12 +0800 Message-Id: <1299514932-13558-6-git-send-email-shawn.guo@linaro.org> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1299514932-13558-1-git-send-email-shawn.guo@linaro.org> References: <1299514932-13558-1-git-send-email-shawn.guo@linaro.org> With the platform clock support, the 'struct clk' should have been associated with device_node->data. So the use of function __of_clk_get_from_provider can be eliminated. Signed-off-by: Shawn Guo --- drivers/of/clock.c | 23 ++--------------------- 1 files changed, 2 insertions(+), 21 deletions(-) diff --git a/drivers/of/clock.c b/drivers/of/clock.c index 7b5ea67..f124d0a 100644 --- a/drivers/of/clock.c +++ b/drivers/of/clock.c @@ -71,24 +71,6 @@ void of_clk_del_provider(struct device_node *np, mutex_unlock(&of_clk_lock); } -static struct clk *__of_clk_get_from_provider(struct device_node *np, const char *clk_output) -{ - struct of_clk_provider *provider; - struct clk *clk = NULL; - - /* Check if we have such a provider in our array */ - mutex_lock(&of_clk_lock); - list_for_each_entry(provider, &of_clk_providers, link) { - if (provider->node == np) - clk = provider->get(np, clk_output, provider->data); - if (clk) - break; - } - mutex_unlock(&of_clk_lock); - - return clk; -} - struct clk *of_clk_get(struct device *dev, const char *id) { struct device_node *provnode; @@ -123,9 +105,8 @@ struct clk *of_clk_get(struct device *dev, const char *id) __func__, prop_name, dev->of_node->full_name); return NULL; } - clk = __of_clk_get_from_provider(provnode, prop); - if (clk) - dev_dbg(dev, "Using clock from %s\n", provnode->full_name); + + clk = provnode->data; of_node_put(provnode);