Commit d8645847 authored by Tobias Klauser's avatar Tobias Klauser Committed by David S. Miller

ethoc: Use resource_size

Use the resource_size function instead of manually calculating the
resource size.
Signed-off-by: default avatarTobias Klauser <tklauser@distanz.ch>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent c5bab5e9
...@@ -904,7 +904,7 @@ static int ethoc_probe(struct platform_device *pdev) ...@@ -904,7 +904,7 @@ static int ethoc_probe(struct platform_device *pdev)
} }
mmio = devm_request_mem_region(&pdev->dev, res->start, mmio = devm_request_mem_region(&pdev->dev, res->start,
res->end - res->start + 1, res->name); resource_size(res), res->name);
if (!mmio) { if (!mmio) {
dev_err(&pdev->dev, "cannot request I/O memory space\n"); dev_err(&pdev->dev, "cannot request I/O memory space\n");
ret = -ENXIO; ret = -ENXIO;
...@@ -917,7 +917,7 @@ static int ethoc_probe(struct platform_device *pdev) ...@@ -917,7 +917,7 @@ static int ethoc_probe(struct platform_device *pdev)
res = platform_get_resource(pdev, IORESOURCE_MEM, 1); res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
if (res) { if (res) {
mem = devm_request_mem_region(&pdev->dev, res->start, mem = devm_request_mem_region(&pdev->dev, res->start,
res->end - res->start + 1, res->name); resource_size(res), res->name);
if (!mem) { if (!mem) {
dev_err(&pdev->dev, "cannot request memory space\n"); dev_err(&pdev->dev, "cannot request memory space\n");
ret = -ENXIO; ret = -ENXIO;
...@@ -945,7 +945,7 @@ static int ethoc_probe(struct platform_device *pdev) ...@@ -945,7 +945,7 @@ static int ethoc_probe(struct platform_device *pdev)
priv->dma_alloc = 0; priv->dma_alloc = 0;
priv->iobase = devm_ioremap_nocache(&pdev->dev, netdev->base_addr, priv->iobase = devm_ioremap_nocache(&pdev->dev, netdev->base_addr,
mmio->end - mmio->start + 1); resource_size(mmio));
if (!priv->iobase) { if (!priv->iobase) {
dev_err(&pdev->dev, "cannot remap I/O memory space\n"); dev_err(&pdev->dev, "cannot remap I/O memory space\n");
ret = -ENXIO; ret = -ENXIO;
...@@ -954,7 +954,7 @@ static int ethoc_probe(struct platform_device *pdev) ...@@ -954,7 +954,7 @@ static int ethoc_probe(struct platform_device *pdev)
if (netdev->mem_end) { if (netdev->mem_end) {
priv->membase = devm_ioremap_nocache(&pdev->dev, priv->membase = devm_ioremap_nocache(&pdev->dev,
netdev->mem_start, mem->end - mem->start + 1); netdev->mem_start, resource_size(mem));
if (!priv->membase) { if (!priv->membase) {
dev_err(&pdev->dev, "cannot remap memory space\n"); dev_err(&pdev->dev, "cannot remap memory space\n");
ret = -ENXIO; ret = -ENXIO;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment