[<prev] [next>] [day] [month] [year] [list]
Date: Fri, 11 Dec 2009 19:33:01 -0500
From: "H Hartley Sweeten" <hartleys@...ionengravers.com>
To: "kernel list" <linux-kernel@...r.kernel.org>
Subject: [PATCH] hdpu_nexus.c: use resource_size()
The ioremap size is off by 1, use resource_size() to get the correct
size.
Signed-off-by: H Hartley Sweeten <hsweeten@...ionengravers.com>
---
diff --git a/drivers/misc/hdpuftrs/hdpu_nexus.c b/drivers/misc/hdpuftrs/hdpu_nexus.c
index ce39fa5..bce5029 100644
--- a/drivers/misc/hdpuftrs/hdpu_nexus.c
+++ b/drivers/misc/hdpuftrs/hdpu_nexus.c
@@ -92,8 +92,7 @@ static int hdpu_nexus_probe(struct platform_device *pdev)
"Invalid memory resource.\n");
return -EINVAL;
}
- nexus_id_addr = ioremap(res->start,
- (unsigned long)(res->end - res->start));
+ nexus_id_addr = ioremap(res->start, resource_size(res));
if (nexus_id_addr) {
slot_id = (*nexus_id_addr >> 8) & 0x1f;
chassis_id = *nexus_id_addr & 0xff;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists