summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorTobias Klauser <tklauser@distanz.ch>2010-05-11 09:10:23 +0200
committerGreg Kroah-Hartman <gregkh@suse.de>2010-05-21 09:34:30 -0700
commite114474cf5c7fe7ab94dd4f5938ffa51c9af77c4 (patch)
treeecf15b6b570aa7d0bfa92fe0e71c9d085622b1a5 /drivers
parentccc5ca8d4cadc141d6c97ec0213cdd676616a11d (diff)
downloadlinux-3.10-e114474cf5c7fe7ab94dd4f5938ffa51c9af77c4.tar.gz
linux-3.10-e114474cf5c7fe7ab94dd4f5938ffa51c9af77c4.tar.bz2
linux-3.10-e114474cf5c7fe7ab94dd4f5938ffa51c9af77c4.zip
serial: bfin_sport_uart: Use resource size to fix off-by-one error
Use the resource_size function instead of manually calculating the resource size. This actually fixes an off-by-one error. Signed-off-by: Tobias Klauser <tklauser@distanz.ch> Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/serial/bfin_sport_uart.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/serial/bfin_sport_uart.c b/drivers/serial/bfin_sport_uart.c
index 66cda2290de..e57fb3d228e 100644
--- a/drivers/serial/bfin_sport_uart.c
+++ b/drivers/serial/bfin_sport_uart.c
@@ -774,8 +774,7 @@ static int __devinit sport_uart_probe(struct platform_device *pdev)
goto out_error_free_peripherals;
}
- sport->port.membase = ioremap(res->start,
- res->end - res->start);
+ sport->port.membase = ioremap(res->start, resource_size(res));
if (!sport->port.membase) {
dev_err(&pdev->dev, "Cannot map sport IO\n");
ret = -ENXIO;