[PATCH 16/45] clk: lmk04832: Make sure clk_init_data is fully initialized
Geert Uytterhoeven
geert+renesas at glider.be
Fri Aug 21 01:53:26 PDT 2026
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 at glider.be>
---
Compile-tested only.
---
drivers/clk/clk-lmk04832.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/clk/clk-lmk04832.c b/drivers/clk/clk-lmk04832.c
index f9a0684d2628eb7a..10e5cfa96e6be195 100644
--- a/drivers/clk/clk-lmk04832.c
+++ b/drivers/clk/clk-lmk04832.c
@@ -587,8 +587,8 @@ static const struct clk_ops lmk04832_vco_ops = {
*/
static int lmk04832_register_vco(struct lmk04832 *lmk)
{
+ struct clk_init_data init = {};
const char *parent_names[1];
- struct clk_init_data init;
int ret;
init.name = "lmk-vco";
@@ -947,8 +947,8 @@ static const struct clk_ops lmk04832_sclk_ops = {
static int lmk04832_register_sclk(struct lmk04832 *lmk)
{
+ struct clk_init_data init = {};
const char *parent_names[1];
- struct clk_init_data init;
int ret;
init.name = "lmk-sclk";
@@ -1292,8 +1292,8 @@ static int lmk04832_register_clkout(struct lmk04832 *lmk, const int num)
{
char name[] = "lmk-clkoutXX";
char dclk_name[] = "lmk-dclkXX_YY";
+ struct clk_init_data init = {};
const char *parent_names[2];
- struct clk_init_data init;
int dclk_num = num / 2;
int ret;
--
2.43.0
More information about the Linux-mediatek
mailing list