diff options
author | Tobias Klauser <tklauser@distanz.ch> | 2010-05-05 18:12:20 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-05-06 04:31:29 -0400 |
commit | 575400bf5d57f53a767bc215bd709e65e5b27a5c (patch) | |
tree | b895be3ba73af562a624dfa564224471947e5f03 /drivers/net/xilinx_emaclite.c | |
parent | 627c8a041f7aaaea93c766f69bd61d952a277586 (diff) |
net: emaclite: Use resource_size
Use the resource_size function instead of manually calculating the
resource size. This reduces the chance of introducing off-by-one
errors.
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/xilinx_emaclite.c')
-rw-r--r-- | drivers/net/xilinx_emaclite.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/xilinx_emaclite.c b/drivers/net/xilinx_emaclite.c index e9381fe3baf4..93828d565390 100644 --- a/drivers/net/xilinx_emaclite.c +++ b/drivers/net/xilinx_emaclite.c | |||
@@ -1171,7 +1171,7 @@ static int __devinit xemaclite_of_probe(struct of_device *ofdev, | |||
1171 | } | 1171 | } |
1172 | 1172 | ||
1173 | /* Get the virtual base address for the device */ | 1173 | /* Get the virtual base address for the device */ |
1174 | lp->base_addr = ioremap(r_mem.start, r_mem.end - r_mem.start + 1); | 1174 | lp->base_addr = ioremap(r_mem.start, resource_size(&r_mem)); |
1175 | if (NULL == lp->base_addr) { | 1175 | if (NULL == lp->base_addr) { |
1176 | dev_err(dev, "EmacLite: Could not allocate iomem\n"); | 1176 | dev_err(dev, "EmacLite: Could not allocate iomem\n"); |
1177 | rc = -EIO; | 1177 | rc = -EIO; |
@@ -1224,7 +1224,7 @@ static int __devinit xemaclite_of_probe(struct of_device *ofdev, | |||
1224 | return 0; | 1224 | return 0; |
1225 | 1225 | ||
1226 | error1: | 1226 | error1: |
1227 | release_mem_region(ndev->mem_start, r_mem.end - r_mem.start + 1); | 1227 | release_mem_region(ndev->mem_start, resource_size(&r_mem)); |
1228 | 1228 | ||
1229 | error2: | 1229 | error2: |
1230 | xemaclite_remove_ndev(ndev); | 1230 | xemaclite_remove_ndev(ndev); |