* [PATCH] regulator: tps65219: Fix is_enabled checking in tps65219_set_bypass
@ 2022-09-19 12:23 Axel Lin
2022-09-27 11:20 ` Mark Brown
0 siblings, 1 reply; 2+ messages in thread
From: Axel Lin @ 2022-09-19 12:23 UTC (permalink / raw)
To: Mark Brown; +Cc: Jerome Neanne, Liam Girdwood, linux-kernel, Axel Lin
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>
---
drivers/regulator/tps65219-regulator.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/regulator/tps65219-regulator.c b/drivers/regulator/tps65219-regulator.c
index b198dcc60bc7..c484c943e467 100644
--- 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 */
--
2.34.1
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [PATCH] regulator: tps65219: Fix is_enabled checking in tps65219_set_bypass
2022-09-19 12:23 [PATCH] regulator: tps65219: Fix is_enabled checking in tps65219_set_bypass Axel Lin
@ 2022-09-27 11:20 ` Mark Brown
0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2022-09-27 11:20 UTC (permalink / raw)
To: Axel Lin; +Cc: Jerome Neanne, linux-kernel, Liam Girdwood
On Mon, 19 Sep 2022 20:23:53 +0800, Axel Lin wrote:
> Testing .enable cannot tell if a regulator is enabled or not, check return
> value of .is_enabled() instead.
> Also remove unneeded ret variable.
>
>
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git for-next
Thanks!
[1/1] regulator: tps65219: Fix is_enabled checking in tps65219_set_bypass
commit: 947934e389f716d505a656d04388b2ecbe43281d
All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying
to this mail.
Thanks,
Mark
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-09-27 11:21 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-19 12:23 [PATCH] regulator: tps65219: Fix is_enabled checking in tps65219_set_bypass Axel Lin
2022-09-27 11:20 ` Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®