mirror of
https://github.com/torvalds/linux.git
synced 2026-11-07 06:17:02 +01:00
clk: imx: 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> Acked-by: Abel Vesa <abel.vesa@oss.qualcomm.com> Message-ID: <7300fde72b6449d2cd7c043e4caec9a6c4171424.1787239813.git.geert+renesas@glider.be> Signed-off-by: Brian Masney <bmasney@redhat.com>
This commit is contained in:
parent
7a2a3a1dbe
commit
b61d1be7a8
|
|
@ -78,8 +78,8 @@ struct clk_hw *imx_clk_hw_busy_divider(const char *name, const char *parent_name
|
|||
void __iomem *busy_reg, u8 busy_shift)
|
||||
{
|
||||
struct clk_busy_divider *busy;
|
||||
struct clk_init_data init = {};
|
||||
struct clk_hw *hw;
|
||||
struct clk_init_data init;
|
||||
int ret;
|
||||
|
||||
busy = kzalloc_obj(*busy);
|
||||
|
|
@ -157,9 +157,9 @@ struct clk_hw *imx_clk_hw_busy_mux(const char *name, void __iomem *reg, u8 shift
|
|||
u8 width, void __iomem *busy_reg, u8 busy_shift,
|
||||
const char * const *parent_names, int num_parents)
|
||||
{
|
||||
struct clk_init_data init = {};
|
||||
struct clk_busy_mux *busy;
|
||||
struct clk_hw *hw;
|
||||
struct clk_init_data init;
|
||||
int ret;
|
||||
|
||||
busy = kzalloc_obj(*busy);
|
||||
|
|
|
|||
|
|
@ -76,9 +76,9 @@ struct clk_hw *imx_clk_hw_cpu(const char *name, const char *parent_name,
|
|||
struct clk *div, struct clk *mux, struct clk *pll,
|
||||
struct clk *step)
|
||||
{
|
||||
struct clk_init_data init = {};
|
||||
struct clk_cpu *cpu;
|
||||
struct clk_hw *hw;
|
||||
struct clk_init_data init;
|
||||
int ret;
|
||||
|
||||
cpu = kzalloc_obj(*cpu);
|
||||
|
|
|
|||
|
|
@ -179,8 +179,8 @@ struct clk_hw *imx_clk_hw_divider_gate(const char *name, const char *parent_name
|
|||
const struct clk_div_table *table,
|
||||
spinlock_t *lock)
|
||||
{
|
||||
struct clk_init_data init;
|
||||
struct clk_divider_gate *div_gate;
|
||||
struct clk_init_data init = {};
|
||||
struct clk_hw *hw;
|
||||
u32 val;
|
||||
int ret;
|
||||
|
|
|
|||
|
|
@ -90,8 +90,8 @@ struct clk_hw *imx_clk_hw_fixup_divider(const char *name, const char *parent,
|
|||
void (*fixup)(u32 *val))
|
||||
{
|
||||
struct clk_fixup_div *fixup_div;
|
||||
struct clk_init_data init = {};
|
||||
struct clk_hw *hw;
|
||||
struct clk_init_data init;
|
||||
int ret;
|
||||
|
||||
if (!fixup)
|
||||
|
|
|
|||
|
|
@ -70,8 +70,8 @@ struct clk_hw *imx_clk_hw_fixup_mux(const char *name, void __iomem *reg,
|
|||
int num_parents, void (*fixup)(u32 *val))
|
||||
{
|
||||
struct clk_fixup_mux *fixup_mux;
|
||||
struct clk_init_data init = {};
|
||||
struct clk_hw *hw;
|
||||
struct clk_init_data init;
|
||||
int ret;
|
||||
|
||||
if (!fixup)
|
||||
|
|
|
|||
|
|
@ -208,7 +208,7 @@ struct clk_hw *imx_clk_hw_frac_pll(const char *name,
|
|||
const char *parent_name,
|
||||
void __iomem *base)
|
||||
{
|
||||
struct clk_init_data init;
|
||||
struct clk_init_data init = {};
|
||||
struct clk_frac_pll *pll;
|
||||
struct clk_hw *hw;
|
||||
int ret;
|
||||
|
|
|
|||
|
|
@ -363,9 +363,9 @@ static struct clk_hw *_imx_clk_fracn_gppll(const char *name, const char *parent_
|
|||
const struct imx_fracn_gppll_clk *pll_clk,
|
||||
u32 pll_flags)
|
||||
{
|
||||
struct clk_init_data init = {};
|
||||
struct clk_fracn_gppll *pll;
|
||||
struct clk_hw *hw;
|
||||
struct clk_init_data init;
|
||||
int ret;
|
||||
|
||||
pll = kzalloc_obj(*pll);
|
||||
|
|
|
|||
|
|
@ -158,9 +158,9 @@ struct clk_hw *imx93_clk_gate(struct device *dev, const char *name, const char *
|
|||
unsigned long flags, void __iomem *reg, u32 bit_idx, u32 val,
|
||||
u32 mask, u32 domain_id, unsigned int *share_count)
|
||||
{
|
||||
struct clk_init_data init = {};
|
||||
struct imx93_clk_gate *gate;
|
||||
struct clk_hw *hw;
|
||||
struct clk_init_data init;
|
||||
int ret;
|
||||
u32 authen;
|
||||
|
||||
|
|
|
|||
|
|
@ -59,9 +59,9 @@ struct clk_hw *imx_clk_hw_gate_exclusive(const char *name, const char *parent,
|
|||
void __iomem *reg, u8 shift, u32 exclusive_mask)
|
||||
{
|
||||
struct clk_gate_exclusive *exgate;
|
||||
struct clk_init_data init = {};
|
||||
struct clk_gate *gate;
|
||||
struct clk_hw *hw;
|
||||
struct clk_init_data init;
|
||||
int ret;
|
||||
|
||||
if (exclusive_mask == 0)
|
||||
|
|
|
|||
|
|
@ -139,9 +139,9 @@ struct clk_hw *clk_hw_register_gate2(struct device *dev, const char *name,
|
|||
u8 clk_gate2_flags, spinlock_t *lock,
|
||||
unsigned int *share_count)
|
||||
{
|
||||
struct clk_init_data init = {};
|
||||
struct clk_gate2 *gate;
|
||||
struct clk_hw *hw;
|
||||
struct clk_init_data init;
|
||||
int ret;
|
||||
|
||||
gate = kzalloc_obj(struct clk_gate2);
|
||||
|
|
|
|||
|
|
@ -114,8 +114,8 @@ struct clk_hw *__imx_clk_lpcg_scu(struct device *dev, const char *name,
|
|||
const char *parent_name, unsigned long flags,
|
||||
void __iomem *reg, u8 bit_idx, bool hw_gate)
|
||||
{
|
||||
struct clk_init_data init = {};
|
||||
struct clk_lpcg_scu *clk;
|
||||
struct clk_init_data init;
|
||||
struct clk_hw *hw;
|
||||
int ret;
|
||||
|
||||
|
|
|
|||
|
|
@ -127,9 +127,9 @@ static const struct clk_ops clk_pfd_ops = {
|
|||
struct clk_hw *imx_clk_hw_pfd(const char *name, const char *parent_name,
|
||||
void __iomem *reg, u8 idx)
|
||||
{
|
||||
struct clk_init_data init = {};
|
||||
struct clk_pfd *pfd;
|
||||
struct clk_hw *hw;
|
||||
struct clk_init_data init;
|
||||
int ret;
|
||||
|
||||
pfd = kzalloc_obj(*pfd);
|
||||
|
|
|
|||
|
|
@ -203,7 +203,7 @@ static const struct clk_ops clk_pfdv2_ops = {
|
|||
struct clk_hw *imx_clk_hw_pfdv2(enum imx_pfdv2_type type, const char *name,
|
||||
const char *parent_name, void __iomem *reg, u8 idx)
|
||||
{
|
||||
struct clk_init_data init;
|
||||
struct clk_init_data init = {};
|
||||
struct clk_pfdv2 *pfd;
|
||||
struct clk_hw *hw;
|
||||
int ret;
|
||||
|
|
|
|||
|
|
@ -515,9 +515,9 @@ struct clk_hw *imx_dev_clk_hw_pll14xx(struct device *dev, const char *name,
|
|||
const char *parent_name, void __iomem *base,
|
||||
const struct imx_pll14xx_clk *pll_clk)
|
||||
{
|
||||
struct clk_init_data init = {};
|
||||
struct clk_pll14xx *pll;
|
||||
struct clk_hw *hw;
|
||||
struct clk_init_data init;
|
||||
int ret;
|
||||
u32 val;
|
||||
|
||||
|
|
|
|||
|
|
@ -114,9 +114,9 @@ static const struct clk_ops clk_pllv1_ops = {
|
|||
struct clk_hw *imx_clk_hw_pllv1(enum imx_pllv1_type type, const char *name,
|
||||
const char *parent, void __iomem *base)
|
||||
{
|
||||
struct clk_init_data init = {};
|
||||
struct clk_pllv1 *pll;
|
||||
struct clk_hw *hw;
|
||||
struct clk_init_data init;
|
||||
int ret;
|
||||
|
||||
pll = kmalloc_obj(*pll);
|
||||
|
|
|
|||
|
|
@ -249,9 +249,9 @@ static const struct clk_ops clk_pllv2_ops = {
|
|||
struct clk_hw *imx_clk_hw_pllv2(const char *name, const char *parent,
|
||||
void __iomem *base)
|
||||
{
|
||||
struct clk_init_data init = {};
|
||||
struct clk_pllv2 *pll;
|
||||
struct clk_hw *hw;
|
||||
struct clk_init_data init;
|
||||
int ret;
|
||||
|
||||
pll = kzalloc_obj(*pll);
|
||||
|
|
|
|||
|
|
@ -422,8 +422,8 @@ struct clk_hw *imx_clk_hw_pllv3(enum imx_pllv3_type type, const char *name,
|
|||
{
|
||||
struct clk_pllv3 *pll;
|
||||
const struct clk_ops *ops;
|
||||
struct clk_init_data init = {};
|
||||
struct clk_hw *hw;
|
||||
struct clk_init_data init;
|
||||
int ret;
|
||||
|
||||
pll = kzalloc_obj(*pll);
|
||||
|
|
|
|||
|
|
@ -246,9 +246,9 @@ static const struct clk_ops clk_pllv4_ops = {
|
|||
struct clk_hw *imx_clk_hw_pllv4(enum imx_pllv4_type type, const char *name,
|
||||
const char *parent_name, void __iomem *base)
|
||||
{
|
||||
struct clk_init_data init = {};
|
||||
struct clk_pllv4 *pll;
|
||||
struct clk_hw *hw;
|
||||
struct clk_init_data init;
|
||||
int ret;
|
||||
|
||||
pll = kzalloc_obj(*pll);
|
||||
|
|
|
|||
|
|
@ -445,7 +445,7 @@ struct clk_hw *__imx_clk_scu(struct device *dev, const char *name,
|
|||
const char * const *parents, int num_parents,
|
||||
u32 rsrc_id, u8 clk_type)
|
||||
{
|
||||
struct clk_init_data init;
|
||||
struct clk_init_data init = {};
|
||||
struct clk_scu *clk;
|
||||
struct clk_hw *hw;
|
||||
int ret;
|
||||
|
|
@ -839,9 +839,9 @@ struct clk_hw *__imx_clk_gpr_scu(const char *name, const char * const *parent_na
|
|||
bool invert)
|
||||
{
|
||||
struct imx_scu_clk_node *clk_node;
|
||||
struct clk_init_data init = {};
|
||||
struct clk_gpr_scu *clk;
|
||||
struct clk_hw *hw;
|
||||
struct clk_init_data init;
|
||||
int ret;
|
||||
|
||||
if (rsrc_id >= IMX_SC_R_LAST || gpr_id >= IMX_SC_C_LAST)
|
||||
|
|
|
|||
|
|
@ -504,8 +504,8 @@ struct clk_hw *imx_clk_hw_sscg_pll(const char *name,
|
|||
void __iomem *base,
|
||||
unsigned long flags)
|
||||
{
|
||||
struct clk_init_data init = {};
|
||||
struct clk_sscg_pll *pll;
|
||||
struct clk_init_data init;
|
||||
struct clk_hw *hw;
|
||||
int ret;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user