diff options
author | Jason Baron <jbaron@akamai.com> | 2014-06-26 17:58:32 -0400 |
---|---|---|
committer | Borislav Petkov <bp@suse.de> | 2014-07-04 07:46:03 -0400 |
commit | a21e98ce1e0cafac30c1b11e41b9e690d8d93442 (patch) | |
tree | fc243eb3e5128c49d7c1dfbae24d59f6d9afe09c | |
parent | 3a044178cccfeb8664423c2950c499c3a209ed9f (diff) |
x38_edac: make use of lo_hi_readq()
Convert to the generic API.
Signed-off-by: Jason Baron <jbaron@akamai.com>
Link: http://lkml.kernel.org/r/bb9a4cbb980cc7b51be75cbfcf644553bf6a04cd.1403818526.git.jbaron@akamai.com
Signed-off-by: Borislav Petkov <bp@suse.de>
-rw-r--r-- | drivers/edac/x38_edac.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/drivers/edac/x38_edac.c b/drivers/edac/x38_edac.c index 4891b450830b..e644b52c287c 100644 --- a/drivers/edac/x38_edac.c +++ b/drivers/edac/x38_edac.c | |||
@@ -14,6 +14,8 @@ | |||
14 | #include <linux/pci.h> | 14 | #include <linux/pci.h> |
15 | #include <linux/pci_ids.h> | 15 | #include <linux/pci_ids.h> |
16 | #include <linux/edac.h> | 16 | #include <linux/edac.h> |
17 | |||
18 | #include <asm-generic/io-64-nonatomic-lo-hi.h> | ||
17 | #include "edac_core.h" | 19 | #include "edac_core.h" |
18 | 20 | ||
19 | #define X38_REVISION "1.1" | 21 | #define X38_REVISION "1.1" |
@@ -161,11 +163,6 @@ static void x38_clear_error_info(struct mem_ctl_info *mci) | |||
161 | X38_ERRSTS_BITS); | 163 | X38_ERRSTS_BITS); |
162 | } | 164 | } |
163 | 165 | ||
164 | static u64 x38_readq(const void __iomem *addr) | ||
165 | { | ||
166 | return readl(addr) | (((u64)readl(addr + 4)) << 32); | ||
167 | } | ||
168 | |||
169 | static void x38_get_and_clear_error_info(struct mem_ctl_info *mci, | 166 | static void x38_get_and_clear_error_info(struct mem_ctl_info *mci, |
170 | struct x38_error_info *info) | 167 | struct x38_error_info *info) |
171 | { | 168 | { |
@@ -183,9 +180,9 @@ static void x38_get_and_clear_error_info(struct mem_ctl_info *mci, | |||
183 | if (!(info->errsts & X38_ERRSTS_BITS)) | 180 | if (!(info->errsts & X38_ERRSTS_BITS)) |
184 | return; | 181 | return; |
185 | 182 | ||
186 | info->eccerrlog[0] = x38_readq(window + X38_C0ECCERRLOG); | 183 | info->eccerrlog[0] = lo_hi_readq(window + X38_C0ECCERRLOG); |
187 | if (x38_channel_num == 2) | 184 | if (x38_channel_num == 2) |
188 | info->eccerrlog[1] = x38_readq(window + X38_C1ECCERRLOG); | 185 | info->eccerrlog[1] = lo_hi_readq(window + X38_C1ECCERRLOG); |
189 | 186 | ||
190 | pci_read_config_word(pdev, X38_ERRSTS, &info->errsts2); | 187 | pci_read_config_word(pdev, X38_ERRSTS, &info->errsts2); |
191 | 188 | ||
@@ -196,10 +193,10 @@ static void x38_get_and_clear_error_info(struct mem_ctl_info *mci, | |||
196 | * should be UE info. | 193 | * should be UE info. |
197 | */ | 194 | */ |
198 | if ((info->errsts ^ info->errsts2) & X38_ERRSTS_BITS) { | 195 | if ((info->errsts ^ info->errsts2) & X38_ERRSTS_BITS) { |
199 | info->eccerrlog[0] = x38_readq(window + X38_C0ECCERRLOG); | 196 | info->eccerrlog[0] = lo_hi_readq(window + X38_C0ECCERRLOG); |
200 | if (x38_channel_num == 2) | 197 | if (x38_channel_num == 2) |
201 | info->eccerrlog[1] = | 198 | info->eccerrlog[1] = |
202 | x38_readq(window + X38_C1ECCERRLOG); | 199 | lo_hi_readq(window + X38_C1ECCERRLOG); |
203 | } | 200 | } |
204 | 201 | ||
205 | x38_clear_error_info(mci); | 202 | x38_clear_error_info(mci); |