clk: rockchip: Make sure clk_init_data is fully initialized

The clk_init_data structure contains several mutually-exclusive members
for different methods to specify the possible parents of a clock,
prompting drivers to initialize only the members they need.  However,
not initializing all members may cause subtle issues, which are only
exposed when CONFIG_INIT_STACK_ALL_PATTERN or CONFIG_INIT_STACK_NONE is
enabled.

Make sure all members are fully initialized, to avoid such bugs, and to
prevent future breakage when converting drivers to a different method
for specifying the parents.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Heiko Stuebner <heiko@sntech.de>
Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Message-ID: <49127c1f7529acccb17e1408db9f21f6d15aee2b.1787239813.git.geert+renesas@glider.be>
Signed-off-by: Brian Masney <bmasney@redhat.com>
This commit is contained in:
Geert Uytterhoeven 2026-08-21 10:53:38 +02:00 committed by Brian Masney
parent 80e22db07d
commit 6a3a8ca3c9
8 changed files with 8 additions and 8 deletions

View File

@ -304,7 +304,7 @@ struct clk *rockchip_clk_register_cpuclk(const char *name,
int nrates, void __iomem *reg_base, spinlock_t *lock)
{
struct rockchip_cpuclk *cpuclk;
struct clk_init_data init;
struct clk_init_data init = {};
struct clk *clk, *cclk;
int ret;

View File

@ -97,7 +97,7 @@ struct clk *rockchip_clk_register_ddrclk(const char *name, int flags,
spinlock_t *lock)
{
struct rockchip_ddrclk *ddrclk;
struct clk_init_data init;
struct clk_init_data init = {};
struct clk *clk;
ddrclk = kzalloc_obj(*ddrclk);

View File

@ -73,7 +73,7 @@ struct clk *rockchip_clk_register_gate_grf(const char *name,
u8 gate_flags)
{
struct rockchip_gate_grf *gate;
struct clk_init_data init;
struct clk_init_data init = {};
struct clk *clk;
if (IS_ERR(regmap)) {

View File

@ -75,8 +75,8 @@ struct clk *rockchip_clk_register_inverter(const char *name,
void __iomem *reg, int shift, int flags,
spinlock_t *lock)
{
struct clk_init_data init;
struct rockchip_inv_clock *inv_clock;
struct clk_init_data init = {};
struct clk *clk;
inv_clock = kmalloc_obj(*inv_clock);

View File

@ -205,8 +205,8 @@ struct clk *rockchip_clk_register_mmc(const char *name,
struct regmap *grf, int grf_reg,
int shift)
{
struct clk_init_data init;
struct rockchip_mmc_clock *mmc_clock;
struct clk_init_data init = {};
struct clk *clk;
int ret;

View File

@ -59,7 +59,7 @@ struct clk *rockchip_clk_register_muxgrf(const char *name,
int shift, int width, int mux_flags)
{
struct rockchip_muxgrf_clock *muxgrf_clock;
struct clk_init_data init;
struct clk_init_data init = {};
struct clk *clk;
if (IS_ERR(regmap)) {

View File

@ -1069,7 +1069,7 @@ struct clk *rockchip_clk_register_pll(struct rockchip_clk_provider *ctx,
unsigned long flags, u8 clk_pll_flags)
{
const char *pll_parents[3];
struct clk_init_data init;
struct clk_init_data init = {};
struct rockchip_clk_pll *pll;
struct clk_mux *pll_mux;
struct clk *pll_clk, *mux_clk;

View File

@ -257,7 +257,7 @@ static struct clk *rockchip_clk_register_frac_branch(
if (child) {
struct clk_mux *frac_mux = &frac->mux;
struct clk_init_data init;
struct clk_init_data init = {};
struct clk *mux_clk;
int ret;