Skip to content

Commit 0986b16

Browse files
Finn Thaingeertu
authored andcommitted
m68k/mac: Use correct PMU response format
Now that the 68k Mac port has adopted the via-pmu driver, it must decode the PMU response accordingly otherwise the date and time will be wrong. Fixes: ebd7222 ("macintosh/via-pmu: Replace via-pmu68k driver with via-pmu driver") Signed-off-by: Finn Thain <fthain@telegraphics.com.au> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
1 parent 5b394b2 commit 0986b16

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)