projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
21c93a9
)
regulator: tps65219: Fix is_enabled checking in tps65219_set_bypass
author
Axel Lin
<axel.lin@ingics.com>
Mon, 19 Sep 2022 12:23:53 +0000
(20:23 +0800)
committer
Mark Brown
<broonie@kernel.org>
Mon, 26 Sep 2022 15:10:33 +0000
(16:10 +0100)
Testing .enable cannot tell if a regulator is enabled or not, check return
value of .is_enabled() instead.
Also remove unneeded ret variable.
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Link:
https://lore.kernel.org/r/20220919122353.384171-1-axel.lin@ingics.com
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/regulator/tps65219-regulator.c
patch
|
blob
|
history
diff --git
a/drivers/regulator/tps65219-regulator.c
b/drivers/regulator/tps65219-regulator.c
index b198dcc60bc78c144544ef879d64540af319950a..c484c943e4675d11e25edfe0bf22843e58fea0b8 100644
(file)
--- a/
drivers/regulator/tps65219-regulator.c
+++ b/
drivers/regulator/tps65219-regulator.c
@@
-181,16
+181,14
@@
static int tps65219_set_bypass(struct regulator_dev *dev, bool enable)
{
struct tps65219 *tps = rdev_get_drvdata(dev);
unsigned int rid = rdev_get_id(dev);
- int ret = 0;
- if (dev->desc->ops->
enable
) {
+ if (dev->desc->ops->
is_enabled(dev)
) {
dev_err(tps->dev,
"%s LDO%d enabled, must be shut down to set bypass ",
__func__, rid);
return -EBUSY;
}
- ret = regulator_set_bypass_regmap(dev, enable);
- return ret;
+ return regulator_set_bypass_regmap(dev, enable);
}
/* Operations permitted on BUCK1/2/3 */