From patchwork Fri Mar 18 18:24:32 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shawn Guo X-Patchwork-Id: 676 Return-Path: Delivered-To: unknown Received: from imap.gmail.com (74.125.159.109) by localhost6.localdomain6 with IMAP4-SSL; 08 Jun 2011 14:44:38 -0000 Delivered-To: patches@linaro.org Received: by 10.220.28.198 with SMTP id n6cs33462vcc; Fri, 18 Mar 2011 11:25:49 -0700 (PDT) Received: by 10.42.162.65 with SMTP id w1mr1966089icx.334.1300472748327; Fri, 18 Mar 2011 11:25:48 -0700 (PDT) Received: from mail-iy0-f178.google.com (mail-iy0-f178.google.com [209.85.210.178]) by mx.google.com with ESMTPS id xn20si4593901icb.94.2011.03.18.11.25.46 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 18 Mar 2011 11:25:47 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.210.178 is neither permitted nor denied by best guess record for domain of shawn.guo@linaro.org) client-ip=209.85.210.178; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.210.178 is neither permitted nor denied by best guess record for domain of shawn.guo@linaro.org) smtp.mail=shawn.guo@linaro.org Received: by iyi12 with SMTP id 12so5306837iyi.37 for ; Fri, 18 Mar 2011 11:25:46 -0700 (PDT) Received: by 10.42.138.195 with SMTP id d3mr1912008icu.241.1300472540228; Fri, 18 Mar 2011 11:22:20 -0700 (PDT) Received: from localhost.localdomain ([114.216.152.45]) by mx.google.com with ESMTPS id mv26sm736763ibb.6.2011.03.18.11.22.12 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 18 Mar 2011 11:22:19 -0700 (PDT) From: Shawn Guo To: devicetree-discuss@lists.ozlabs.org Cc: linaro-dev@lists.linaro.org, patches@linaro.org, grant.likely@secretlab.ca, Shawn Guo Subject: [PATCH v2 6/6] of/clock: eliminate function __of_clk_get_from_provider Date: Sat, 19 Mar 2011 02:24:32 +0800 Message-Id: <1300472672-13392-7-git-send-email-shawn.guo@linaro.org> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1300472672-13392-1-git-send-email-shawn.guo@linaro.org> References: <1300472672-13392-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..1b34937 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->clk; of_node_put(provnode);