]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/4.4.157/macintosh-via-pmu-add-missing-mmio-accessors.patch
4.9-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 4.4.157 / macintosh-via-pmu-add-missing-mmio-accessors.patch
CommitLineData
7be860c4
GKH
1From foo@baz Mon Sep 17 12:15:09 CEST 2018
2From: Finn Thain <fthain@telegraphics.com.au>
3Date: Mon, 2 Jul 2018 04:21:18 -0400
4Subject: macintosh/via-pmu: Add missing mmio accessors
5
6From: Finn Thain <fthain@telegraphics.com.au>
7
8[ Upstream commit 576d5290d678a651b9f36050fc1717e0573aca13 ]
9
10Add missing in_8() accessors to init_pmu() and pmu_sr_intr().
11
12This fixes several sparse warnings:
13drivers/macintosh/via-pmu.c:536:29: warning: dereference of noderef expression
14drivers/macintosh/via-pmu.c:537:33: warning: dereference of noderef expression
15drivers/macintosh/via-pmu.c:1455:17: warning: dereference of noderef expression
16drivers/macintosh/via-pmu.c:1456:69: warning: dereference of noderef expression
17
18Tested-by: Stan Johnson <userm57@yahoo.com>
19Signed-off-by: Finn Thain <fthain@telegraphics.com.au>
20Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org>
21Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
22Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
23Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
24---
25 drivers/macintosh/via-pmu.c | 9 +++++----
26 1 file changed, 5 insertions(+), 4 deletions(-)
27
28--- a/drivers/macintosh/via-pmu.c
29+++ b/drivers/macintosh/via-pmu.c
30@@ -530,8 +530,9 @@ init_pmu(void)
31 int timeout;
32 struct adb_request req;
33
34- out_8(&via[B], via[B] | TREQ); /* negate TREQ */
35- out_8(&via[DIRB], (via[DIRB] | TREQ) & ~TACK); /* TACK in, TREQ out */
36+ /* Negate TREQ. Set TACK to input and TREQ to output. */
37+ out_8(&via[B], in_8(&via[B]) | TREQ);
38+ out_8(&via[DIRB], (in_8(&via[DIRB]) | TREQ) & ~TACK);
39
40 pmu_request(&req, NULL, 2, PMU_SET_INTR_MASK, pmu_intr_mask);
41 timeout = 100000;
42@@ -1453,8 +1454,8 @@ pmu_sr_intr(void)
43 struct adb_request *req;
44 int bite = 0;
45
46- if (via[B] & TREQ) {
47- printk(KERN_ERR "PMU: spurious SR intr (%x)\n", via[B]);
48+ if (in_8(&via[B]) & TREQ) {
49+ printk(KERN_ERR "PMU: spurious SR intr (%x)\n", in_8(&via[B]));
50 out_8(&via[IFR], SR_INT);
51 return NULL;
52 }