serial: bfin_sport_uart: Use resource size to fix off-by-one error
authorTobias Klauser <tklauser@distanz.ch>
Tue, 11 May 2010 07:10:23 +0000 (09:10 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 21 May 2010 16:34:30 +0000 (09:34 -0700)
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>
drivers/serial/bfin_sport_uart.c

index 66cda2290de06bf0d64fa23f1b0a4a9eb380eb76..e57fb3d228e2dd0881ab10f3410a457b46e0e405 100644 (file)
@@ -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;