linux-clk.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] clk: gpio: Fix buggy merge
@ 2016-02-19 17:29 Fabio Estevam
  0 siblings, 0 replies; only message in thread
From: Fabio Estevam @ 2016-02-19 17:29 UTC (permalink / raw)
  To: mturquette; +Cc: sboyd, linux, linux-clk, Fabio Estevam

From: Fabio Estevam <fabio.estevam@nxp.com>

Clock maintainer mis-merged Russell King's commit 7ed88aa2efa54
("clk: fix clk-gpio.c with optional clock= DT property")
causing the gpio-gate-clock not to be registered.

Adjust the code, so that it looks like Russell's original submission.

With this fix in place, Wifi chip can be successfully probed on a
imx6q-cubox-i.

Suggested-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
---
 drivers/clk/clk-gpio.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/clk/clk-gpio.c b/drivers/clk/clk-gpio.c
index 19fed65..05cca92 100644
--- a/drivers/clk/clk-gpio.c
+++ b/drivers/clk/clk-gpio.c
@@ -287,15 +287,12 @@ static void __init of_gpio_clk_setup(struct device_node *node,
 	const char **parent_names;
 	int i, num_parents;
 
-	num_parents = of_clk_get_parent_count(node);
-	if (num_parents < 0)
-		return;
-
 	data = kzalloc(sizeof(*data), GFP_KERNEL);
 	if (!data)
 		return;
 
-	if (num_parents) {
+	num_parents = of_clk_get_parent_count(node);
+	if (num_parents > 0) {
 		parent_names = kcalloc(num_parents, sizeof(char *), GFP_KERNEL);
 		if (!parent_names) {
 			kfree(data);
-- 
1.9.1

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2016-02-19 17:29 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-19 17:29 [PATCH] clk: gpio: Fix buggy merge Fabio Estevam

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).