Hi Yong,
Looks good, just a couple of things:
diff --git a/arch/arm/common/clkdev.c b/arch/arm/common/clkdev.c index 9e4c4d9..cf81e70 100644 --- a/arch/arm/common/clkdev.c +++ b/arch/arm/common/clkdev.c
Why not do this in the core clock code (kernel/clk.c) instead? No need to make it ARM-specific.
diff --git a/arch/arm/plat-mxc/clock-common.c b/arch/arm/plat-mxc/clock-common.c index 8911813..20d38a8 100644 --- a/arch/arm/plat-mxc/clock-common.c +++ b/arch/arm/plat-mxc/clock-common.c @@ -97,7 +97,10 @@ unsigned long clk_mxc_get_rate(struct clk *_clk) if (clk->get_rate) return clk->get_rate(clk);
- return clk_get_rate(clk->parent);
- if (clk->parent)
- return clk_get_rate(clk->parent);
- return 0;
}
/* Round the requested clock rate to the nearest supported diff --git a/include/linux/clk.h b/include/linux/clk.h index 56416b7..1102c2c 100644 --- a/include/linux/clk.h +++ b/include/linux/clk.h @@ -44,17 +44,31 @@ struct device;
- registered with the arch-specific clock management code; the clock
driver
- code does not need to handle these.
*/ +#define CLK_NAME_LEN 16
We might need more than 16 bytes here; 32 should be fine.
struct clk { const struct clk_ops *ops; unsigned int enable_count; struct mutex mutex; +#ifdef CONFIG_CLK_DEBUG
- char name[CLK_NAME_LEN];
- struct dentry *dentry;
+#endif };
-#define INIT_CLK(name, o) { \ +#ifndef CONFIG_CLK_DEBUG +#define INIT_CLK(clk_name, o) { \ .ops = &o, \ .enable_count = 0, \
- .mutex = __MUTEX_INITIALIZER(name.mutex), \
- .mutex = __MUTEX_INITIALIZER(clk_name.mutex), \
} +#else +#define INIT_CLK(clk_name, o) { \
- .ops = &o, \
- .enable_count = 0, \
- .mutex = __MUTEX_INITIALIZER(clk_name.mutex), \
- .name = #clk_name, \
+} +#endif
How about this instead:
+#ifdef CONFIG_CLK_DEBUG +#define __INIT_CLK_DEBUG(n) .name = #n, +#else +#define __INIT_CLK_DEBUG(n) +#endif + /* static initialiser for non-atomic clocks */ #define INIT_CLK(name, o) { \ .ops = &o, \ .enable_count = 0, \ .flags = 0, \ .lock.mutex = __MUTEX_INITIALIZER(name.lock.mutex), \ + __INIT_CLK_DEBUG(name) \ }
/* static initialiser for atomic clocks */
- otherwise, you're going to need to add another definition of INIT_CLK_ATOMIC too, giving four in total.
Cheers,
Jeremy