Skip to content

Commit 01f6543

Browse files
committed
Merge tag 'm68k-for-v4.19-tag2' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/linux-m68k
Pull m68k fix from Geert Uytterhoeven: "Just a single fix for a bug introduced during the merge window: fix wrong date and time on PMU-based Macs" * tag 'm68k-for-v4.19-tag2' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/linux-m68k: m68k/mac: Use correct PMU response format
2 parents 754cf4b + 0986b16 commit 01f6543

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

arch/m68k/mac/misc.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -98,11 +98,10 @@ static time64_t pmu_read_time(void)
9898

9999
if (pmu_request(&req, NULL, 1, PMU_READ_RTC) < 0)
100100
return 0;
101-
while (!req.complete)
102-
pmu_poll();
101+
pmu_wait_complete(&req);
103102

104-
time = (u32)((req.reply[1] << 24) | (req.reply[2] << 16) |
105-
(req.reply[3] << 8) | req.reply[4]);
103+
time = (u32)((req.reply[0] << 24) | (req.reply[1] << 16) |
104+
(req.reply[2] << 8) | req.reply[3]);
106105

107106
return time - RTC_OFFSET;
108107
}
@@ -116,8 +115,7 @@ static void pmu_write_time(time64_t time)
116115
(data >> 24) & 0xFF, (data >> 16) & 0xFF,
117116
(data >> 8) & 0xFF, data & 0xFF) < 0)
118117
return;
119-
while (!req.complete)
120-
pmu_poll();
118+
pmu_wait_complete(&req);
121119
}
122120

123121
static __u8 pmu_read_pram(int offset)

0 commit comments

Comments
 (0)