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>
This commit is contained in:
Axel Lin 2019-05-04 11:33:36 +08:00 committed by Mark Brown
parent e2a23affe6
commit 68ce3a4461
No known key found for this signature in database
GPG Key ID: 24D68B725D5487D0
1 changed files with 3 additions and 3 deletions

View File

@ -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(