提交 e114474c 编写于 作者: T Tobias Klauser 提交者: Greg Kroah-Hartman

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: NTobias Klauser <tklauser@distanz.ch>
Signed-off-by: NMike Frysinger <vapier@gentoo.org>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 ccc5ca8d
...@@ -774,8 +774,7 @@ static int __devinit sport_uart_probe(struct platform_device *pdev) ...@@ -774,8 +774,7 @@ static int __devinit sport_uart_probe(struct platform_device *pdev)
goto out_error_free_peripherals; goto out_error_free_peripherals;
} }
sport->port.membase = ioremap(res->start, sport->port.membase = ioremap(res->start, resource_size(res));
res->end - res->start);
if (!sport->port.membase) { if (!sport->port.membase) {
dev_err(&pdev->dev, "Cannot map sport IO\n"); dev_err(&pdev->dev, "Cannot map sport IO\n");
ret = -ENXIO; ret = -ENXIO;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册