From: <dinguyen@opensource.altera.com>
To: <sboyd@codeaurora.org>, <mturquette@linaro.org>
Cc: <dinh.linux@gmail.com>, <linux-clk@vger.kernel.org>,
<linux-kernel@vger.kernel.org>,
Dinh Nguyen <dinguyen@opensource.altera.com>,
Peter Griffin <peter.griffin@linaro.org>
Subject: [PATCHv2 4/6] clk: st: make use of of_clk_parent_fill helper function
Date: Mon, 6 Jul 2015 22:59:04 -0500 [thread overview]
Message-ID: <1436241546-16731-5-git-send-email-dinguyen@opensource.altera.com> (raw)
In-Reply-To: <1436241546-16731-1-git-send-email-dinguyen@opensource.altera.com>
From: Dinh Nguyen <dinguyen@opensource.altera.com>
Use of_clk_parent_fill to fill in the parent clock names' array.
Signed-off-by: Dinh Nguyen <dinguyen@opensource.altera.com>
Tested-by Gabriel Fernandez <gabriel.fernandez@st.com>
Cc: Peter Griffin <peter.griffin@linaro.org>
---
drivers/clk/st/clk-flexgen.c | 6 ++----
drivers/clk/st/clkgen-mux.c | 7 ++-----
2 files changed, 4 insertions(+), 9 deletions(-)
diff --git a/drivers/clk/st/clk-flexgen.c b/drivers/clk/st/clk-flexgen.c
index 657ca14..ed0696c 100644
--- a/drivers/clk/st/clk-flexgen.c
+++ b/drivers/clk/st/clk-flexgen.c
@@ -243,7 +243,7 @@ static const char ** __init flexgen_get_parents(struct device_node *np,
int *num_parents)
{
const char **parents;
- int nparents, i;
+ int nparents;
nparents = of_clk_get_parent_count(np);
if (WARN_ON(nparents <= 0))
@@ -253,10 +253,8 @@ static const char ** __init flexgen_get_parents(struct device_node *np,
if (!parents)
return NULL;
- for (i = 0; i < nparents; i++)
- parents[i] = of_clk_get_parent_name(np, i);
+ *num_parents = of_clk_parent_fill(np, parents, nparents);
- *num_parents = nparents;
return parents;
}
diff --git a/drivers/clk/st/clkgen-mux.c b/drivers/clk/st/clkgen-mux.c
index 4fbe6e0..b83654a 100644
--- a/drivers/clk/st/clkgen-mux.c
+++ b/drivers/clk/st/clkgen-mux.c
@@ -24,7 +24,7 @@ static const char ** __init clkgen_mux_get_parents(struct device_node *np,
int *num_parents)
{
const char **parents;
- int nparents, i;
+ int nparents;
nparents = of_clk_get_parent_count(np);
if (WARN_ON(nparents <= 0))
@@ -34,10 +34,7 @@ static const char ** __init clkgen_mux_get_parents(struct device_node *np,
if (!parents)
return ERR_PTR(-ENOMEM);
- for (i = 0; i < nparents; i++)
- parents[i] = of_clk_get_parent_name(np, i);
-
- *num_parents = nparents;
+ *num_parents = of_clk_parent_fill(np, parents, nparents);
return parents;
}
--
1.7.9.5
next prev parent reply other threads:[~2015-07-07 4:06 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-07 3:59 [PATCHv2 0/6] clk: " dinguyen
2015-07-07 3:59 ` [PATCHv2 1/6] clk: at91: " dinguyen
2015-07-18 0:52 ` Stephen Boyd
2015-07-07 3:59 ` [PATCHv2 2/6] clk: qoriq: " dinguyen
2015-07-18 0:52 ` Stephen Boyd
2015-07-07 3:59 ` [PATCHv2 3/6] clk: keystone: " dinguyen
2015-07-18 0:52 ` Stephen Boyd
2015-07-07 3:59 ` dinguyen [this message]
2015-07-18 0:52 ` [PATCHv2 4/6] clk: st: " Stephen Boyd
2015-07-07 3:59 ` [PATCHv2 5/6] clk: sunxi: " dinguyen
2015-07-07 5:07 ` Maxime Ripard
2015-07-18 0:52 ` Stephen Boyd
2015-07-18 0:53 ` Stephen Boyd
2015-07-21 14:42 ` Tyler Baker
2015-07-21 15:22 ` Dinh Nguyen
2015-07-21 16:29 ` Tyler Baker
2015-07-21 18:00 ` Stephen Boyd
2015-07-07 3:59 ` [PATCHv2 6/6] clk: ti: " dinguyen
2015-07-18 0:52 ` Stephen Boyd
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1436241546-16731-5-git-send-email-dinguyen@opensource.altera.com \
--to=dinguyen@opensource.altera.com \
--cc=dinh.linux@gmail.com \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mturquette@linaro.org \
--cc=peter.griffin@linaro.org \
--cc=sboyd@codeaurora.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®