Skip to content

Commit

Permalink
serial: bfin_sport_uart: Use resource size to fix off-by-one error
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Tobias Klauser authored and Greg Kroah-Hartman committed May 21, 2010
1 parent ccc5ca8 commit e114474
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/serial/bfin_sport_uart.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit e114474

Please sign in to comment.