Skip to content

Commit 484f0f5

Browse files
tititiou36lag-linaro
authored andcommitted
mfd: exynos-lpass: Fix an error handling path in exynos_lpass_probe()
If an error occurs after a successful regmap_init_mmio(), regmap_exit() should be called as already done in the .remove() function. Switch to devm_regmap_init_mmio() to avoid the leak and simplify the .remove() function. Fixes: c414df1 ("mfd: exynos-lpass: Add missing remove() function") Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Link: https://lore.kernel.org/r/38414eecb1096840946756ae86887aea2a489c1b.1745247209.git.christophe.jaillet@wanadoo.fr Signed-off-by: Lee Jones <lee@kernel.org>
1 parent 9bc2d48 commit 484f0f5

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

drivers/mfd/exynos-lpass.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,8 @@ static int exynos_lpass_probe(struct platform_device *pdev)
122122
if (IS_ERR(lpass->sfr0_clk))
123123
return PTR_ERR(lpass->sfr0_clk);
124124

125-
lpass->top = regmap_init_mmio(dev, base_top,
126-
&exynos_lpass_reg_conf);
125+
lpass->top = devm_regmap_init_mmio(dev, base_top,
126+
&exynos_lpass_reg_conf);
127127
if (IS_ERR(lpass->top)) {
128128
dev_err(dev, "LPASS top regmap initialization failed\n");
129129
return PTR_ERR(lpass->top);
@@ -145,7 +145,6 @@ static void exynos_lpass_remove(struct platform_device *pdev)
145145
pm_runtime_disable(&pdev->dev);
146146
if (!pm_runtime_status_suspended(&pdev->dev))
147147
exynos_lpass_disable(lpass);
148-
regmap_exit(lpass->top);
149148
}
150149

151150
static int __maybe_unused exynos_lpass_suspend(struct device *dev)

0 commit comments

Comments
 (0)