Skip to contentSkip to conversation

sh: Skip uninitialized hwblk clocks

PATCH New Magnus Damm 1 participant 1 message May 10, 2010 SuperH

lore
Share & tools
lore
#0 lore raw

PATCH 1/13 sh: Skip uninitialized hwblk clocks

From: Magnus Damm <[email protected]>

Update the common hwblk clk code to skip over uninitialized clocks. Useful when registering clocks in an [HWBLK_NR] array.

---

 arch/sh/kernel/cpu/hwblk.c |    5 +++++
 1 file changed, 5 insertions(+)
arch/sh/kernel/cpu/hwblk.c +5 -0
@@ -146,6 +146,11 @@ int __init sh_hwblk_clk_register(struct 
 
 	for (k = 0; !ret && (k < nr); k++) {
 		clkp = clks + k;
+
+		/* skip over clocks using hwblk 0 (HWBLK_UNKNOWN) */
+		if (!clkp->arch_flags)
+			continue;
+
 		clkp->ops = &sh_hwblk_clk_ops;
 		ret |= clk_register(clkp);
 	}