projects
/
platform
/
kernel
/
linux-starfive.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e0cbc20
)
mfd: stmpe: Only disable the regulators if they are enabled
author
Christophe JAILLET
<christophe.jaillet@wanadoo.fr>
Sat, 17 Jun 2023 10:43:16 +0000
(12:43 +0200)
committer
Lee Jones
<lee@kernel.org>
Wed, 21 Jun 2023 17:45:37 +0000
(18:45 +0100)
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>
drivers/mfd/stmpe.c
patch
|
blob
|
history
diff --git
a/drivers/mfd/stmpe.c
b/drivers/mfd/stmpe.c
index
a92301d
..
9c3cf58
100644
(file)
--- a/
drivers/mfd/stmpe.c
+++ b/
drivers/mfd/stmpe.c
@@
-1485,9
+1485,9
@@
int stmpe_probe(struct stmpe_client_info *ci, enum stmpe_partnum partnum)
void stmpe_remove(struct stmpe *stmpe)
{
- if (!IS_ERR(stmpe->vio))
+ if (!IS_ERR(stmpe->vio)
&& regulator_is_enabled(stmpe->vio)
)
regulator_disable(stmpe->vio);
- if (!IS_ERR(stmpe->vcc))
+ if (!IS_ERR(stmpe->vcc)
&& regulator_is_enabled(stmpe->vcc)
)
regulator_disable(stmpe->vcc);
__stmpe_disable(stmpe, STMPE_BLOCK_ADC);