]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
mfd: stmpe: Only disable the regulators if they are enabled
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Sat, 17 Jun 2023 10:43:16 +0000 (12:43 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 11 Aug 2023 09:33:40 +0000 (11:33 +0200)
commitba9cd5e59b8faab40b5d735c00a448060024f8cc
treebcaa2d6d757e4ad6f9b228e4e91e357b4f873129
parentc930665de2b02f7a5431a895de37ca669ff76f37
mfd: stmpe: Only disable the regulators if they are enabled

[ Upstream commit 104d32bd81f620bb9f67fbf7d1159c414e89f05f ]

In stmpe_probe(), if some regulator_enable() calls fail, probing continues
and there is only a dev_warn().

So, if stmpe_probe() is called the regulator may not be enabled. It is
cleaner to test it before calling regulator_disable() in the remove
function.

Fixes: 9c9e321455fb ("mfd: stmpe: add optional regulators")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/8de3aaf297931d655b9ad6aed548f4de8b85425a.1686998575.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Lee Jones <lee@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/mfd/stmpe.c