clk: mxs: 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: <b6aed754c64c4709646cac9cafaf57825af67c6a.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:31 +02:00 committed by Brian Masney
parent 9d31f4b021
commit 523fd58a9c
4 changed files with 4 additions and 4 deletions

View File

@ -70,9 +70,9 @@ static const struct clk_ops clk_div_ops = {
struct clk *mxs_clk_div(const char *name, const char *parent_name,
void __iomem *reg, u8 shift, u8 width, u8 busy)
{
struct clk_init_data init = {};
struct clk_div *div;
struct clk *clk;
struct clk_init_data init;
div = kzalloc_obj(*div);
if (!div)

View File

@ -112,9 +112,9 @@ static const struct clk_ops clk_frac_ops = {
struct clk *mxs_clk_frac(const char *name, const char *parent_name,
void __iomem *reg, u8 shift, u8 width, u8 busy)
{
struct clk_init_data init = {};
struct clk_frac *frac;
struct clk *clk;
struct clk_init_data init;
frac = kzalloc_obj(*frac);
if (!frac)

View File

@ -82,9 +82,9 @@ static const struct clk_ops clk_pll_ops = {
struct clk *mxs_clk_pll(const char *name, const char *parent_name,
void __iomem *base, u8 power, unsigned long rate)
{
struct clk_init_data init = {};
struct clk_pll *pll;
struct clk *clk;
struct clk_init_data init;
pll = kzalloc_obj(*pll);
if (!pll)

View File

@ -113,9 +113,9 @@ static const struct clk_ops clk_ref_ops = {
struct clk *mxs_clk_ref(const char *name, const char *parent_name,
void __iomem *reg, u8 idx)
{
struct clk_init_data init = {};
struct clk_ref *ref;
struct clk *clk;
struct clk_init_data init;
ref = kzalloc_obj(*ref);
if (!ref)