Skip to contentSkip to conversation

clk: gpio: Fix buggy merge

PATCH New Fabio Estevam 1 participant 1 message Feb 19, 2016 Common clk

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 clk: gpio: Fix buggy merge

From: Fabio Estevam <[email protected]>

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.

---
 drivers/clk/clk-gpio.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
drivers/clk/clk-gpio.c +2 -5
index 19fed65..05cca92 100644
@@ -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);
Signature · 1 line
1.9.1