clk: stm32mp1: fix missing spin_lock_init()
authorWang Hai <wanghai38@huawei.com>
Wed, 30 Jun 2021 01:58:23 +0000 (09:58 +0800)
committerStephen Boyd <sboyd@kernel.org>
Wed, 30 Jun 2021 18:17:20 +0000 (11:17 -0700)
The driver allocates the spinlock but not initialize it.
Use spin_lock_init() on it to initialize it correctly.

Fixes: c392df194a2d ("clk: stm32mp1: move RCC reset controller into RCC clock driver")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Wang Hai <wanghai38@huawei.com>
Link: https://lore.kernel.org/r/20210630015824.2555840-1-wanghai38@huawei.com
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
drivers/clk/clk-stm32mp1.c

index 6adc625..256575b 100644 (file)
@@ -2263,6 +2263,7 @@ static int stm32_rcc_reset_init(struct device *dev, void __iomem *base,
        if (!reset_data)
                return -ENOMEM;
 
+       spin_lock_init(&reset_data->lock);
        reset_data->membase = base;
        reset_data->rcdev.owner = THIS_MODULE;
        reset_data->rcdev.ops = &stm32_reset_ops;