summaryrefslogtreecommitdiff
path: root/drivers/regulator/core.c
diff options
context:
space:
mode:
authorAxel Lin <axel.lin@ingics.com>2019-05-04 06:33:36 +0300
committerMark Brown <broonie@kernel.org>2019-05-08 11:32:28 +0300
commit68ce3a4461726ebd3acf9d94841a46386402a058 (patch)
tree73b915a492355e057b231c8038fa4fcc2959556f /drivers/regulator/core.c
parente2a23affe6a6a15111ae56edd7e4f3c9673ef201 (diff)
downloadlinux-68ce3a4461726ebd3acf9d94841a46386402a058.tar.xz
regulator: core: Slightly improve readability of _regulator_get_enable_time
The logic is equivalent, but it looks more straightforward this way: If rdev->desc->ops->enable_time is set, call it. Otherwise fallback to return rdev->desc->enable_time. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/regulator/core.c')
-rw-r--r--drivers/regulator/core.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index 955a0a15b9cb..bf4cdbcf0653 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -1650,9 +1650,9 @@ static int _regulator_get_enable_time(struct regulator_dev *rdev)
{
if (rdev->constraints && rdev->constraints->enable_time)
return rdev->constraints->enable_time;
- if (!rdev->desc->ops->enable_time)
- return rdev->desc->enable_time;
- return rdev->desc->ops->enable_time(rdev);
+ if (rdev->desc->ops->enable_time)
+ return rdev->desc->ops->enable_time(rdev);
+ return rdev->desc->enable_time;
}
static struct regulator_supply_alias *regulator_find_supply_alias(