clk: uniphier: 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>
Message-ID: <491e41d759cec667d6bcd742673e1fec70b4bc31.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:48 +02:00 committed by Brian Masney
parent 888a064a78
commit fcd74898a4
5 changed files with 5 additions and 5 deletions

View File

@ -79,7 +79,7 @@ struct clk_hw *uniphier_clk_register_cpugear(struct device *dev,
const struct uniphier_clk_cpugear_data *data)
{
struct uniphier_clk_cpugear *gear;
struct clk_init_data init;
struct clk_init_data init = {};
int ret;
gear = devm_kzalloc(dev, sizeof(*gear), GFP_KERNEL);

View File

@ -13,8 +13,8 @@ struct clk_hw *uniphier_clk_register_fixed_factor(struct device *dev,
const char *name,
const struct uniphier_clk_fixed_factor_data *data)
{
struct clk_init_data init = {};
struct clk_fixed_factor *fix;
struct clk_init_data init;
int ret;
fix = devm_kzalloc(dev, sizeof(*fix), GFP_KERNEL);

View File

@ -13,8 +13,8 @@ struct clk_hw *uniphier_clk_register_fixed_rate(struct device *dev,
const char *name,
const struct uniphier_clk_fixed_rate_data *data)
{
struct clk_init_data init = {};
struct clk_fixed_rate *fixed;
struct clk_init_data init;
int ret;
/* allocate fixed-rate clock */

View File

@ -61,8 +61,8 @@ struct clk_hw *uniphier_clk_register_gate(struct device *dev,
const char *name,
const struct uniphier_clk_gate_data *data)
{
struct clk_init_data init = {};
struct uniphier_clk_gate *gate;
struct clk_init_data init;
int ret;
gate = devm_kzalloc(dev, sizeof(*gate), GFP_KERNEL);

View File

@ -58,8 +58,8 @@ struct clk_hw *uniphier_clk_register_mux(struct device *dev,
const char *name,
const struct uniphier_clk_mux_data *data)
{
struct clk_init_data init = {};
struct uniphier_clk_mux *mux;
struct clk_init_data init;
int ret;
mux = devm_kzalloc(dev, sizeof(*mux), GFP_KERNEL);