Skip to content

Commit fd7ee8d

Browse files
committed
Merge tag 'regulator-fix-v6.3' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator
Pull regulator fixes from Mark Brown: "Two fixes here, one driver fix for incorrect error codes and a fix in the core to use ktime_get_boottime() in order to fix accounting of the time regulators have been powered down over suspend. ktime_get() pauses over suspend which is not what we want" * tag 'regulator-fix-v6.3' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator: regulator: core: Use ktime_get_boottime() to determine how long a regulator was off regulator: max597x: Fix error return code in max597x_get_status
2 parents ee3f96b + 80d2c29 commit fd7ee8d

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

drivers/regulator/core.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1584,7 +1584,7 @@ static int set_machine_constraints(struct regulator_dev *rdev)
15841584
}
15851585

15861586
if (rdev->desc->off_on_delay)
1587-
rdev->last_off = ktime_get();
1587+
rdev->last_off = ktime_get_boottime();
15881588

15891589
/* If the constraints say the regulator should be on at this point
15901590
* and we have control then make sure it is enabled.
@@ -2673,7 +2673,7 @@ static int _regulator_do_enable(struct regulator_dev *rdev)
26732673
* this regulator was disabled.
26742674
*/
26752675
ktime_t end = ktime_add_us(rdev->last_off, rdev->desc->off_on_delay);
2676-
s64 remaining = ktime_us_delta(end, ktime_get());
2676+
s64 remaining = ktime_us_delta(end, ktime_get_boottime());
26772677

26782678
if (remaining > 0)
26792679
_regulator_delay_helper(remaining);
@@ -2912,7 +2912,7 @@ static int _regulator_do_disable(struct regulator_dev *rdev)
29122912
}
29132913

29142914
if (rdev->desc->off_on_delay)
2915-
rdev->last_off = ktime_get();
2915+
rdev->last_off = ktime_get_boottime();
29162916

29172917
trace_regulator_disable_complete(rdev_get_name(rdev));
29182918

drivers/regulator/max597x-regulator.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ static int max597x_get_status(struct regulator_dev *rdev)
193193

194194
ret = regmap_read(rdev->regmap, MAX5970_REG_STATUS3, &val);
195195
if (ret)
196-
return REGULATOR_FAILED_RETRY;
196+
return ret;
197197

198198
if (val & MAX5970_STATUS3_ALERT)
199199
return REGULATOR_STATUS_ERROR;

0 commit comments

Comments
 (0)