Commit 495ac33a authored by Viresh Kumar's avatar Viresh Kumar

soc/tegra: pmc: Don't allocate struct tegra_powergate on stack

With a later commit an instance of the struct device will be added to
struct genpd and with that the size of the struct tegra_powergate will
be over 1024 bytes. That generates following warning:

drivers/soc/tegra/pmc.c:579:1: warning: the frame size of 1200 bytes is larger than 1024 bytes [-Wframe-larger-than=]

Avoid such warnings by allocating the structure dynamically.
Signed-off-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
Acked-by: default avatarThierry Reding <treding@nvidia.com>
parent 75bc37fe
...@@ -559,22 +559,28 @@ EXPORT_SYMBOL(tegra_powergate_remove_clamping); ...@@ -559,22 +559,28 @@ EXPORT_SYMBOL(tegra_powergate_remove_clamping);
int tegra_powergate_sequence_power_up(unsigned int id, struct clk *clk, int tegra_powergate_sequence_power_up(unsigned int id, struct clk *clk,
struct reset_control *rst) struct reset_control *rst)
{ {
struct tegra_powergate pg; struct tegra_powergate *pg;
int err; int err;
if (!tegra_powergate_is_available(id)) if (!tegra_powergate_is_available(id))
return -EINVAL; return -EINVAL;
pg.id = id; pg = kzalloc(sizeof(*pg), GFP_KERNEL);
pg.clks = &clk; if (!pg)
pg.num_clks = 1; return -ENOMEM;
pg.reset = rst;
pg.pmc = pmc;
err = tegra_powergate_power_up(&pg, false); pg->id = id;
pg->clks = &clk;
pg->num_clks = 1;
pg->reset = rst;
pg->pmc = pmc;
err = tegra_powergate_power_up(pg, false);
if (err) if (err)
pr_err("failed to turn on partition %d: %d\n", id, err); pr_err("failed to turn on partition %d: %d\n", id, err);
kfree(pg);
return err; return err;
} }
EXPORT_SYMBOL(tegra_powergate_sequence_power_up); EXPORT_SYMBOL(tegra_powergate_sequence_power_up);
......
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