diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index ae69e493913d..4fcd36055b02 100644 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c @@ -1584,7 +1584,7 @@ static int set_machine_constraints(struct regulator_dev *rdev) } if (rdev->desc->off_on_delay) - rdev->last_off = ktime_get(); + rdev->last_off = ktime_get_boottime(); /* If the constraints say the regulator should be on at this point * and we have control then make sure it is enabled. @@ -2673,7 +2673,7 @@ static int _regulator_do_enable(struct regulator_dev *rdev) * this regulator was disabled. */ ktime_t end = ktime_add_us(rdev->last_off, rdev->desc->off_on_delay); - s64 remaining = ktime_us_delta(end, ktime_get()); + s64 remaining = ktime_us_delta(end, ktime_get_boottime()); if (remaining > 0) _regulator_delay_helper(remaining); @@ -2912,7 +2912,7 @@ static int _regulator_do_disable(struct regulator_dev *rdev) } if (rdev->desc->off_on_delay) - rdev->last_off = ktime_get(); + rdev->last_off = ktime_get_boottime(); trace_regulator_disable_complete(rdev_get_name(rdev)); diff --git a/drivers/regulator/max597x-regulator.c b/drivers/regulator/max597x-regulator.c index f0fb0f56e420..648e3641885a 100644 --- a/drivers/regulator/max597x-regulator.c +++ b/drivers/regulator/max597x-regulator.c @@ -193,7 +193,7 @@ static int max597x_get_status(struct regulator_dev *rdev) ret = regmap_read(rdev->regmap, MAX5970_REG_STATUS3, &val); if (ret) - return REGULATOR_FAILED_RETRY; + return ret; if (val & MAX5970_STATUS3_ALERT) return REGULATOR_STATUS_ERROR;