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)
{
struct clockdomain *clkdm;
if (!clk->clkdm_name)
if (!clk->clkdm.name)
return;
clkdm = clkdm_lookup(clk->clkdm_name);
clkdm = clkdm_lookup(clk->clkdm.name);
if (clkdm) {
pr_debug("clock: associated clk %s to clkdm %s\n",
clk->name, clk->clkdm_name);
clk->clkdm = clkdm;
clk->name, clk->clkdm.name);
clk->clkdm.ptr = clkdm;
} else {
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)
_omap2_clk_disable(clk);
if (clk->parent)
omap2_clk_disable(clk->parent);
if (clk->clkdm)
omap2_clkdm_clk_disable(clk->clkdm, clk);
if (clk->clkdm.ptr)
omap2_clkdm_clk_disable(clk->clkdm.ptr, clk);
}
}
......@@ -400,14 +400,14 @@ int omap2_clk_enable(struct clk *clk)
return ret;
}
if (clk->clkdm)
omap2_clkdm_clk_enable(clk->clkdm, clk);
if (clk->clkdm.ptr)
omap2_clkdm_clk_enable(clk->clkdm.ptr, clk);
ret = _omap2_clk_enable(clk);
if (ret != 0) {
if (clk->clkdm)
omap2_clkdm_clk_disable(clk->clkdm, clk);
if (clk->clkdm.ptr)
omap2_clkdm_clk_disable(clk->clkdm.ptr, clk);
if (clk->parent) {
omap2_clk_disable(clk->parent);
......
This diff is collapsed.
This diff is collapsed.
......@@ -81,8 +81,10 @@ struct clk {
u32 clksel_mask;
const struct clksel *clksel;
struct dpll_data *dpll_data;
const char *clkdm_name;
struct clockdomain *clkdm;
union {
const char *name;
struct clockdomain *ptr;
} clkdm;
#else
__u8 rate_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