mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* drivers/block/mg_disk.c: use resource_size()
@ 2009-11-23 17:39 H Hartley Sweeten
  2009-11-27  4:32 ` unsik Kim
  0 siblings, 1 reply; 2+ messages in thread
From: H Hartley Sweeten @ 2009-11-23 17:39 UTC (permalink / raw)
  To: linux-kernel; +Cc: donari75

Use resource_size() for ioremap.

The ioremap appears to be passing the incorrect size for the platform
resource.  Unfortunately, I can't locate a user in mainline to verify
this.  Using resource_size should be the correct fix.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: unsik Kim <donari75@gmail.com>

---

diff --git a/drivers/block/mg_disk.c b/drivers/block/mg_disk.c
index e0339aa..02b2583 100644
--- a/drivers/block/mg_disk.c
+++ b/drivers/block/mg_disk.c
@@ -860,7 +860,7 @@ static int mg_probe(struct platform_device *plat_dev)
 		err = -EINVAL;
 		goto probe_err_2;
 	}
-	host->dev_base = ioremap(rsc->start , rsc->end + 1);
+	host->dev_base = ioremap(rsc->start, resource_size(rsc));
 	if (!host->dev_base) {
 		printk(KERN_ERR "%s:%d ioremap fail\n",
 				__func__, __LINE__); 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-11-27  4:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-11-23 17:39 drivers/block/mg_disk.c: use resource_size() H Hartley Sweeten
2009-11-27  4:32 ` unsik Kim

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®