Commit 0e5194e1 authored by Paul Walmsley's avatar Paul Walmsley Committed by Tony Lindgren

OMAP2/3 clock: combine clkdm, clkdm_name into union in struct clk

struct clk contains a struct clockdomain *clkdm and const char
*clkdm_name.  The clkdm_name is only used at initialization to look up
the appropriate clkdm pointer.  Combining these into a union saves
about 850 bytes on 3430SDP.  This patch should not cause any change in
kernel function.

Boot-tested on 3430SDP ES2; compile-tested with n800_defconfig.
Signed-off-by: default avatarPaul Walmsley <paul@pwsan.com>

size:
   text    data     bss     dec     hex filename
3391555  157032  107136 3655723  37c82b vmlinux.3430sdp.orig
3391555  156176  107136 3654867  37c4d3 vmlinux.3430sdp
Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
parent 718fc6cd
...@@ -78,17 +78,17 @@ void omap2_init_clk_clkdm(struct clk *clk) ...@@ -78,17 +78,17 @@ void omap2_init_clk_clkdm(struct clk *clk)
{ {
struct clockdomain *clkdm; struct clockdomain *clkdm;
if (!clk->clkdm_name) if (!clk->clkdm.name)
return; return;
clkdm = clkdm_lookup(clk->clkdm_name); clkdm = clkdm_lookup(clk->clkdm.name);
if (clkdm) { if (clkdm) {
pr_debug("clock: associated clk %s to clkdm %s\n", pr_debug("clock: associated clk %s to clkdm %s\n",
clk->name, clk->clkdm_name); clk->name, clk->clkdm.name);
clk->clkdm = clkdm; clk->clkdm.ptr = clkdm;
} else { } else {
pr_debug("clock: could not associate clk %s to " pr_debug("clock: could not associate clk %s to "
"clkdm %s\n", clk->name, clk->clkdm_name); "clkdm %s\n", clk->name, clk->clkdm.name);
} }
} }
...@@ -381,8 +381,8 @@ void omap2_clk_disable(struct clk *clk) ...@@ -381,8 +381,8 @@ void omap2_clk_disable(struct clk *clk)
_omap2_clk_disable(clk); _omap2_clk_disable(clk);
if (clk->parent) if (clk->parent)
omap2_clk_disable(clk->parent); omap2_clk_disable(clk->parent);
if (clk->clkdm) if (clk->clkdm.ptr)
omap2_clkdm_clk_disable(clk->clkdm, clk); omap2_clkdm_clk_disable(clk->clkdm.ptr, clk);
} }
} }
...@@ -400,14 +400,14 @@ int omap2_clk_enable(struct clk *clk) ...@@ -400,14 +400,14 @@ int omap2_clk_enable(struct clk *clk)
return ret; return ret;
} }
if (clk->clkdm) if (clk->clkdm.ptr)
omap2_clkdm_clk_enable(clk->clkdm, clk); omap2_clkdm_clk_enable(clk->clkdm.ptr, clk);
ret = _omap2_clk_enable(clk); ret = _omap2_clk_enable(clk);
if (ret != 0) { if (ret != 0) {
if (clk->clkdm) if (clk->clkdm.ptr)
omap2_clkdm_clk_disable(clk->clkdm, clk); omap2_clkdm_clk_disable(clk->clkdm.ptr, clk);
if (clk->parent) { if (clk->parent) {
omap2_clk_disable(clk->parent); omap2_clk_disable(clk->parent);
......
This diff is collapsed.
This diff is collapsed.
...@@ -81,8 +81,10 @@ struct clk { ...@@ -81,8 +81,10 @@ struct clk {
u32 clksel_mask; u32 clksel_mask;
const struct clksel *clksel; const struct clksel *clksel;
struct dpll_data *dpll_data; struct dpll_data *dpll_data;
const char *clkdm_name; union {
struct clockdomain *clkdm; const char *name;
struct clockdomain *ptr;
} clkdm;
#else #else
__u8 rate_offset; __u8 rate_offset;
__u8 src_offset; __u8 src_offset;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment