From patchwork Mon Mar 14 13:18:42 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shawn Guo X-Patchwork-Id: 546 Return-Path: Delivered-To: unknown Received: from imap.gmail.com (74.125.159.109) by localhost6.localdomain6 with IMAP4-SSL; 08 Jun 2011 14:43:35 -0000 Delivered-To: patches@linaro.org Received: by 10.224.45.75 with SMTP id d11cs55691qaf; Mon, 14 Mar 2011 06:16:52 -0700 (PDT) Received: by 10.90.126.17 with SMTP id y17mr3169395agc.64.1300108612378; Mon, 14 Mar 2011 06:16:52 -0700 (PDT) Received: from mail-yi0-f50.google.com (mail-yi0-f50.google.com [209.85.218.50]) by mx.google.com with ESMTPS id j25si12813036anh.141.2011.03.14.06.16.52 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 14 Mar 2011 06:16:52 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.218.50 is neither permitted nor denied by best guess record for domain of shawn.guo@linaro.org) client-ip=209.85.218.50; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.218.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 mail-yi0-f50.google.com with SMTP id 30so2539756yie.37 for ; Mon, 14 Mar 2011 06:16:52 -0700 (PDT) Received: by 10.90.23.19 with SMTP id 19mr3149645agw.108.1300108612093; Mon, 14 Mar 2011 06:16:52 -0700 (PDT) Received: from localhost.localdomain ([114.216.146.145]) by mx.google.com with ESMTPS id d14sm6011637ana.0.2011.03.14.06.16.45 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 14 Mar 2011 06:16:51 -0700 (PDT) From: Shawn Guo To: devicetree-discuss@lists.ozlabs.org, linaro-dev@lists.linaro.org Cc: patches@linaro.org, Shawn Guo Subject: [PATCH 5/5] of/clock: eliminate function __of_clk_get_from_provider Date: Mon, 14 Mar 2011 21:18:42 +0800 Message-Id: <1300108722-3254-6-git-send-email-shawn.guo@linaro.org> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1300108722-3254-1-git-send-email-shawn.guo@linaro.org> References: <1300108722-3254-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);