Patchwork drivers/ide/ide_platform.c: use resource_size()

login
register
mail settings
Submitter hartleys
Date Nov. 23, 2009, 6:24 p.m.
Message ID <BD79186B4FD85F4B8E60E381CAEE190901EE5C04@mi8nycmail19.Mi8.com>
Download mbox | patch
Permalink /patch/39065/
State Accepted
Delegated to: David Miller
Headers show

Comments

hartleys - Nov. 23, 2009, 6:24 p.m.
Use resource_size() for devm_{ioremap/io_port_map}.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>

---

--
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Miller - Nov. 23, 2009, 6:30 p.m.
From: "H Hartley Sweeten" <hartleys@visionengravers.com>
Date: Mon, 23 Nov 2009 13:24:20 -0500

> Use resource_size() for devm_{ioremap/io_port_map}.
> 
> Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>

Also applied to ide-next-2.6, thanks.
--
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/drivers/ide/ide_platform.c b/drivers/ide/ide_platform.c
index b579fbe..42965b3 100644
--- a/drivers/ide/ide_platform.c
+++ b/drivers/ide/ide_platform.c
@@ -81,14 +81,14 @@  static int __devinit plat_ide_probe(struct platform_device *pdev)
 
 	if (mmio) {
 		base = devm_ioremap(&pdev->dev,
-			res_base->start, res_base->end - res_base->start + 1);
+			res_base->start, resource_size(res_base));
 		alt_base = devm_ioremap(&pdev->dev,
-			res_alt->start, res_alt->end - res_alt->start + 1);
+			res_alt->start, resource_size(res_alt));
 	} else {
 		base = devm_ioport_map(&pdev->dev,
-			res_base->start, res_base->end - res_base->start + 1);
+			res_base->start, resource_size(res_base));
 		alt_base = devm_ioport_map(&pdev->dev,
-			res_alt->start, res_alt->end - res_alt->start + 1);
+			res_alt->start, resource_size(res_alt));
 	}
 
 	memset(&hw, 0, sizeof(hw));