aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Shevchenko <[email protected]>2022-06-06 19:41:33 +0300
committerLee Jones <[email protected]>2022-07-14 10:50:36 +0100
commit6adc32f58b9356ced575f9d820e8e3f1f629f830 (patch)
tree16befd31c62e079042a93bc8c44e00b073a08cc3
parent5c7b9167ddf89d2d845e09bfcdc9f677340b6a5c (diff)
EDAC, pnd2: Use proper I/O accessors and address space annotation
The driver uses rather voodoo kind of castings and I/O accessors. Replace it with proper __iomem annotation and readl()/readq() calls. Signed-off-by: Andy Shevchenko <[email protected]> Tested-by: Henning Schild <[email protected]> Reviewed-by: Tony Luck <[email protected]> Signed-off-by: Lee Jones <[email protected]>
-rw-r--r--drivers/edac/pnd2_edac.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/edac/pnd2_edac.c b/drivers/edac/pnd2_edac.c
index c94ca1f790c4..7d1df120e24c 100644
--- a/drivers/edac/pnd2_edac.c
+++ b/drivers/edac/pnd2_edac.c
@@ -265,7 +265,7 @@ static u64 get_sideband_reg_base_addr(void)
static int dnv_rd_reg(int port, int off, int op, void *data, size_t sz, char *name)
{
struct pci_dev *pdev;
- char *base;
+ void __iomem *base;
u64 addr;
unsigned long size;
@@ -297,8 +297,9 @@ static int dnv_rd_reg(int port, int off, int op, void *data, size_t sz, char *na
return -ENODEV;
if (sz == 8)
- *(u32 *)(data + 4) = *(u32 *)(base + off + 4);
- *(u32 *)data = *(u32 *)(base + off);
+ *(u64 *)data = readq(base + off);
+ else
+ *(u32 *)data = readl(base + off);
iounmap(base);
}