Skip to content

Commit 6adc32f

Browse files
andy-shevlag-linaro
authored andcommitted
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 <andriy.shevchenko@linux.intel.com> Tested-by: Henning Schild <henning.schild@siemens.com> Reviewed-by: Tony Luck <tony.luck@intel.com> Signed-off-by: Lee Jones <lee@kernel.org>
1 parent 5c7b916 commit 6adc32f

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

drivers/edac/pnd2_edac.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ static u64 get_sideband_reg_base_addr(void)
265265
static int dnv_rd_reg(int port, int off, int op, void *data, size_t sz, char *name)
266266
{
267267
struct pci_dev *pdev;
268-
char *base;
268+
void __iomem *base;
269269
u64 addr;
270270
unsigned long size;
271271

@@ -297,8 +297,9 @@ static int dnv_rd_reg(int port, int off, int op, void *data, size_t sz, char *na
297297
return -ENODEV;
298298

299299
if (sz == 8)
300-
*(u32 *)(data + 4) = *(u32 *)(base + off + 4);
301-
*(u32 *)data = *(u32 *)(base + off);
300+
*(u64 *)data = readq(base + off);
301+
else
302+
*(u32 *)data = readl(base + off);
302303

303304
iounmap(base);
304305
}

0 commit comments

Comments
 (0)