diff options
author | Dan Carpenter <error27@gmail.com> | 2010-03-21 22:11:45 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-03-22 21:33:11 -0400 |
commit | 38013262c2c815fa404fa9f42dbc958c616fb385 (patch) | |
tree | 863e30091427a63b22397ad46c2b00a755546b30 /drivers/net/korina.c | |
parent | 3e4aa12f8a81506c44f04b4f0eb7663981c5a282 (diff) |
korina: use resource_size()
This size calculation is wrong. It should be end - start + 1.
Use resource_size() to calculate it correctly.
Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/korina.c')
-rw-r--r-- | drivers/net/korina.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/net/korina.c b/drivers/net/korina.c index 300c2249812d..edaedc7aa03f 100644 --- a/drivers/net/korina.c +++ b/drivers/net/korina.c | |||
@@ -1135,7 +1135,7 @@ static int korina_probe(struct platform_device *pdev) | |||
1135 | 1135 | ||
1136 | r = platform_get_resource_byname(pdev, IORESOURCE_MEM, "korina_regs"); | 1136 | r = platform_get_resource_byname(pdev, IORESOURCE_MEM, "korina_regs"); |
1137 | dev->base_addr = r->start; | 1137 | dev->base_addr = r->start; |
1138 | lp->eth_regs = ioremap_nocache(r->start, r->end - r->start); | 1138 | lp->eth_regs = ioremap_nocache(r->start, resource_size(r)); |
1139 | if (!lp->eth_regs) { | 1139 | if (!lp->eth_regs) { |
1140 | printk(KERN_ERR DRV_NAME ": cannot remap registers\n"); | 1140 | printk(KERN_ERR DRV_NAME ": cannot remap registers\n"); |
1141 | rc = -ENXIO; | 1141 | rc = -ENXIO; |
@@ -1143,7 +1143,7 @@ static int korina_probe(struct platform_device *pdev) | |||
1143 | } | 1143 | } |
1144 | 1144 | ||
1145 | r = platform_get_resource_byname(pdev, IORESOURCE_MEM, "korina_dma_rx"); | 1145 | r = platform_get_resource_byname(pdev, IORESOURCE_MEM, "korina_dma_rx"); |
1146 | lp->rx_dma_regs = ioremap_nocache(r->start, r->end - r->start); | 1146 | lp->rx_dma_regs = ioremap_nocache(r->start, resource_size(r)); |
1147 | if (!lp->rx_dma_regs) { | 1147 | if (!lp->rx_dma_regs) { |
1148 | printk(KERN_ERR DRV_NAME ": cannot remap Rx DMA registers\n"); | 1148 | printk(KERN_ERR DRV_NAME ": cannot remap Rx DMA registers\n"); |
1149 | rc = -ENXIO; | 1149 | rc = -ENXIO; |
@@ -1151,7 +1151,7 @@ static int korina_probe(struct platform_device *pdev) | |||
1151 | } | 1151 | } |
1152 | 1152 | ||
1153 | r = platform_get_resource_byname(pdev, IORESOURCE_MEM, "korina_dma_tx"); | 1153 | r = platform_get_resource_byname(pdev, IORESOURCE_MEM, "korina_dma_tx"); |
1154 | lp->tx_dma_regs = ioremap_nocache(r->start, r->end - r->start); | 1154 | lp->tx_dma_regs = ioremap_nocache(r->start, resource_size(r)); |
1155 | if (!lp->tx_dma_regs) { | 1155 | if (!lp->tx_dma_regs) { |
1156 | printk(KERN_ERR DRV_NAME ": cannot remap Tx DMA registers\n"); | 1156 | printk(KERN_ERR DRV_NAME ": cannot remap Tx DMA registers\n"); |
1157 | rc = -ENXIO; | 1157 | rc = -ENXIO; |