summaryrefslogtreecommitdiff
path: root/drivers/power
diff options
context:
space:
mode:
authorWei Yongjun <weiyongjun1@huawei.com>2021-10-13 09:31:15 +0000
committerSebastian Reichel <sebastian.reichel@collabora.com>2021-10-13 14:04:20 +0200
commitdb6e436264dae9fbfc92d93bf61772e8a129940c (patch)
tree8533ec2749d9355d8e07f88018b5bc2565e46eea /drivers/power
parente660dbb68c6b3f7b9eb8b9775846a44f9798b719 (diff)
power: supply: axp288_charger: Fix missing mutex_init()
The driver allocates the mutex but not initialize it. Use mutex_init() on it to initialize it correctly. Fixes: ed229454856e ("power: supply: axp288-charger: Optimize register reading method") Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Diffstat (limited to 'drivers/power')
-rw-r--r--drivers/power/supply/axp288_charger.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/power/supply/axp288_charger.c b/drivers/power/supply/axp288_charger.c
index fd4983c98fd9..9987b1731e38 100644
--- a/drivers/power/supply/axp288_charger.c
+++ b/drivers/power/supply/axp288_charger.c
@@ -865,6 +865,7 @@ static int axp288_charger_probe(struct platform_device *pdev)
if (!info)
return -ENOMEM;
+ mutex_init(&info->lock);
info->pdev = pdev;
info->regmap = axp20x->regmap;
info->regmap_irqc = axp20x->regmap_irqc;