mirror of
https://github.com/torvalds/linux.git
synced 2026-11-07 06:17:02 +01:00
clk: mmp: 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: <c794be8edca2c373b12e925b101f7e298012e5d6.1787239813.git.geert+renesas@glider.be> Signed-off-by: Brian Masney <bmasney@redhat.com>
This commit is contained in:
parent
61f678fa71
commit
6dab17f8c8
|
|
@ -120,9 +120,9 @@ struct clk *mmp_clk_register_apbc(const char *name, const char *parent_name,
|
|||
void __iomem *base, unsigned int delay,
|
||||
unsigned int apbc_flags, spinlock_t *lock)
|
||||
{
|
||||
struct clk_init_data init = {};
|
||||
struct clk_apbc *apbc;
|
||||
struct clk *clk;
|
||||
struct clk_init_data init;
|
||||
|
||||
apbc = kzalloc_obj(*apbc);
|
||||
if (!apbc)
|
||||
|
|
|
|||
|
|
@ -65,9 +65,9 @@ static const struct clk_ops clk_apmu_ops = {
|
|||
struct clk *mmp_clk_register_apmu(const char *name, const char *parent_name,
|
||||
void __iomem *base, u32 enable_mask, spinlock_t *lock)
|
||||
{
|
||||
struct clk_init_data init = {};
|
||||
struct clk_apmu *apmu;
|
||||
struct clk *clk;
|
||||
struct clk_init_data init;
|
||||
|
||||
apmu = kzalloc_obj(*apmu);
|
||||
if (!apmu)
|
||||
|
|
|
|||
|
|
@ -171,8 +171,8 @@ struct clk *mmp_clk_register_factor(const char *name, const char *parent_name,
|
|||
struct mmp_clk_factor_masks *masks,
|
||||
struct u32_fract *ftbl, unsigned int ftbl_cnt, spinlock_t *lock)
|
||||
{
|
||||
struct clk_init_data init = {};
|
||||
struct mmp_clk_factor *factor;
|
||||
struct clk_init_data init;
|
||||
struct clk *clk;
|
||||
|
||||
if (!masks) {
|
||||
|
|
|
|||
|
|
@ -94,9 +94,9 @@ struct clk *mmp_clk_register_gate(struct device *dev, const char *name,
|
|||
void __iomem *reg, u32 mask, u32 val_enable, u32 val_disable,
|
||||
unsigned int gate_flags, spinlock_t *lock)
|
||||
{
|
||||
struct clk_init_data init = {};
|
||||
struct mmp_clk_gate *gate;
|
||||
struct clk *clk;
|
||||
struct clk_init_data init;
|
||||
|
||||
/* allocate the gate */
|
||||
gate = kzalloc_obj(*gate);
|
||||
|
|
|
|||
|
|
@ -444,9 +444,9 @@ struct clk *mmp_clk_register_mix(struct device *dev,
|
|||
struct mmp_clk_mix_config *config,
|
||||
spinlock_t *lock)
|
||||
{
|
||||
struct clk_init_data init = {};
|
||||
struct mmp_clk_mix *mix;
|
||||
struct clk *clk;
|
||||
struct clk_init_data init;
|
||||
|
||||
mix = kzalloc_obj(*mix);
|
||||
if (!mix)
|
||||
|
|
|
|||
|
|
@ -104,9 +104,9 @@ static struct clk *mmp_clk_register_pll(char *name,
|
|||
unsigned long input_rate,
|
||||
void __iomem *postdiv_reg, u8 postdiv_shift)
|
||||
{
|
||||
struct clk_init_data init = {};
|
||||
struct mmp_clk_pll *pll;
|
||||
struct clk *clk;
|
||||
struct clk_init_data init;
|
||||
|
||||
pll = kzalloc_obj(*pll);
|
||||
if (!pll)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user