Skip to content

Commit

Permalink
clk: mark clk_disable_unused() as __init
Browse files Browse the repository at this point in the history
clk_disable_unused is only called once, as a late_initcall, so reclaim
a bit of memory by marking it (and the functions and data it is the
sole user of) as __init/__initdata. This moves ~1900 bytes from .text
to .init.text for a imx_v6_v7_defconfig.

Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Link: https://lkml.kernel.org/r/20191004094826.8320-1-linux@rasmusvillemoes.dk
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
  • Loading branch information
Rasmus Villemoes authored and Stephen Boyd committed Nov 19, 2019
1 parent 8247470 commit 564f86d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions drivers/clk/clk.c
Original file line number Diff line number Diff line change
Expand Up @@ -1187,7 +1187,7 @@ static void clk_core_disable_unprepare(struct clk_core *core)
clk_core_unprepare_lock(core);
}

static void clk_unprepare_unused_subtree(struct clk_core *core)
static void __init clk_unprepare_unused_subtree(struct clk_core *core)
{
struct clk_core *child;

Expand Down Expand Up @@ -1217,7 +1217,7 @@ static void clk_unprepare_unused_subtree(struct clk_core *core)
clk_pm_runtime_put(core);
}

static void clk_disable_unused_subtree(struct clk_core *core)
static void __init clk_disable_unused_subtree(struct clk_core *core)
{
struct clk_core *child;
unsigned long flags;
Expand Down Expand Up @@ -1263,15 +1263,15 @@ static void clk_disable_unused_subtree(struct clk_core *core)
clk_core_disable_unprepare(core->parent);
}

static bool clk_ignore_unused;
static bool clk_ignore_unused __initdata;
static int __init clk_ignore_unused_setup(char *__unused)
{
clk_ignore_unused = true;
return 1;
}
__setup("clk_ignore_unused", clk_ignore_unused_setup);

static int clk_disable_unused(void)
static int __init clk_disable_unused(void)
{
struct clk_core *core;

Expand Down

0 comments on commit 564f86d

Please sign in to comment.