aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2018-08-31 11:42:46 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2018-08-31 11:42:46 -0400
commit01f6543a0dacd8d9901a130b26e9fec080c1f276 (patch)
treeab3adfaa96fdc429589ddb6bc70784195b45e15e
parent754cf4b2432dfea0f925a0b760506a9c97c8f00b (diff)
parent0986b16ab49b18063d29a9e02e9c7fab1928bc8e (diff)
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
-rw-r--r--arch/m68k/mac/misc.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/arch/m68k/mac/misc.c b/arch/m68k/mac/misc.c
index 3534aa6a4dc2..1b083c500b9a 100644
--- a/arch/m68k/mac/misc.c
+++ b/arch/m68k/mac/misc.c
@@ -98,11 +98,10 @@ static time64_t pmu_read_time(void)
98 98
99 if (pmu_request(&req, NULL, 1, PMU_READ_RTC) < 0) 99 if (pmu_request(&req, NULL, 1, PMU_READ_RTC) < 0)
100 return 0; 100 return 0;
101 while (!req.complete) 101 pmu_wait_complete(&req);
102 pmu_poll();
103 102
104 time = (u32)((req.reply[1] << 24) | (req.reply[2] << 16) | 103 time = (u32)((req.reply[0] << 24) | (req.reply[1] << 16) |
105 (req.reply[3] << 8) | req.reply[4]); 104 (req.reply[2] << 8) | req.reply[3]);
106 105
107 return time - RTC_OFFSET; 106 return time - RTC_OFFSET;
108} 107}
@@ -116,8 +115,7 @@ static void pmu_write_time(time64_t time)
116 (data >> 24) & 0xFF, (data >> 16) & 0xFF, 115 (data >> 24) & 0xFF, (data >> 16) & 0xFF,
117 (data >> 8) & 0xFF, data & 0xFF) < 0) 116 (data >> 8) & 0xFF, data & 0xFF) < 0)
118 return; 117 return;
119 while (!req.complete) 118 pmu_wait_complete(&req);
120 pmu_poll();
121} 119}
122 120
123static __u8 pmu_read_pram(int offset) 121static __u8 pmu_read_pram(int offset)