Commit 68ce3a44 authored by Axel Lin's avatar Axel Lin Committed by Mark Brown

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: default avatarAxel Lin <axel.lin@ingics.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent e2a23aff
......@@ -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(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment