mirror of
https://github.com/torvalds/linux.git
synced 2026-11-06 21:58:01 +01:00
clk: hisilicon: 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: <04ef5b163e1ae63ffd6b568d3544c482b43f347f.1787239813.git.geert+renesas@glider.be> Signed-off-by: Brian Masney <bmasney@redhat.com>
This commit is contained in:
parent
530bb0068f
commit
7a2a3a1dbe
|
|
@ -456,8 +456,8 @@ static void hisi_clk_register_pll(struct hi3559av100_pll_clock *clks,
|
|||
{
|
||||
void __iomem *base = data->base;
|
||||
struct hi3559av100_clk_pll *p_clk = NULL;
|
||||
struct clk_init_data init = {};
|
||||
struct clk *clk = NULL;
|
||||
struct clk_init_data init;
|
||||
int i;
|
||||
|
||||
p_clk = devm_kcalloc(dev, nums, sizeof(*p_clk), GFP_KERNEL);
|
||||
|
|
|
|||
|
|
@ -410,9 +410,9 @@ static const struct clk_ops clk_mmc_ops = {
|
|||
static struct clk *hisi_register_clk_mmc(struct hisi_mmc_clock *mmc_clk,
|
||||
void __iomem *base, struct device_node *np)
|
||||
{
|
||||
struct clk_init_data init = {};
|
||||
struct clk_mmc *mclk;
|
||||
struct clk *clk;
|
||||
struct clk_init_data init;
|
||||
|
||||
mclk = kzalloc_obj(*mclk);
|
||||
if (!mclk)
|
||||
|
|
|
|||
|
|
@ -195,7 +195,7 @@ static const struct clk_ops hi6220_stub_clk_ops = {
|
|||
static int hi6220_stub_clk_probe(struct platform_device *pdev)
|
||||
{
|
||||
struct device *dev = &pdev->dev;
|
||||
struct clk_init_data init;
|
||||
struct clk_init_data init = {};
|
||||
struct hi6220_stub_clk *stub_clk;
|
||||
struct clk *clk;
|
||||
struct device_node *np = pdev->dev.of_node;
|
||||
|
|
|
|||
|
|
@ -94,8 +94,8 @@ struct clk *clk_register_hisi_phase(struct device *dev,
|
|||
const struct hisi_phase_clock *clks,
|
||||
void __iomem *base, spinlock_t *lock)
|
||||
{
|
||||
struct clk_init_data init = {};
|
||||
struct clk_hisi_phase *phase;
|
||||
struct clk_init_data init;
|
||||
|
||||
phase = devm_kzalloc(dev, sizeof(struct clk_hisi_phase), GFP_KERNEL);
|
||||
if (!phase)
|
||||
|
|
|
|||
|
|
@ -258,8 +258,8 @@ hix5hd2_clk_register_complex(struct hix5hd2_complex_clock *clks, int nums,
|
|||
|
||||
for (i = 0; i < nums; i++) {
|
||||
struct hix5hd2_clk_complex *p_clk;
|
||||
struct clk_init_data init = {};
|
||||
struct clk *clk;
|
||||
struct clk_init_data init;
|
||||
|
||||
p_clk = kzalloc_obj(*p_clk);
|
||||
if (!p_clk)
|
||||
|
|
|
|||
|
|
@ -103,7 +103,7 @@ struct clk *hi6220_register_clkdiv(struct device *dev, const char *name,
|
|||
{
|
||||
struct hi6220_clk_divider *div;
|
||||
struct clk *clk;
|
||||
struct clk_init_data init;
|
||||
struct clk_init_data init = {};
|
||||
struct clk_div_table *table;
|
||||
u32 max_div, min_div;
|
||||
int i;
|
||||
|
|
|
|||
|
|
@ -87,8 +87,8 @@ struct clk *hisi_register_clkgate_sep(struct device *dev, const char *name,
|
|||
u8 clk_gate_flags, spinlock_t *lock)
|
||||
{
|
||||
struct clkgate_separated *sclk;
|
||||
struct clk_init_data init = {};
|
||||
struct clk *clk;
|
||||
struct clk_init_data init;
|
||||
|
||||
sclk = kzalloc_obj(*sclk);
|
||||
if (!sclk)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user