summaryrefslogtreecommitdiff
path: root/target/linux/brcm63xx/patches-3.8/412-bcm63xx_enet-use-resource_size.patch
blob: ab5971751f657c0b7c86a23c303d2fd788a736d2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
From dbd9b51204aa4114756b8659e180139ef3878032 Mon Sep 17 00:00:00 2001
From: Maxime Bizon <mbizon@freebox.fr>
Date: Thu, 21 Jan 2010 17:28:36 +0100
Subject: [PATCH 28/63] bcm63xx_enet: use resource_size().

---
 drivers/net/ethernet/broadcom/bcm63xx_enet.c |   18 ++++++++----------
 1 files changed, 8 insertions(+), 10 deletions(-)

--- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c
+++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.c
@@ -1594,7 +1594,6 @@ static int bcm_enet_probe(struct platfor
 	struct resource *res_mem, *res_irq, *res_irq_rx, *res_irq_tx;
 	struct mii_bus *bus;
 	const char *clk_name;
-	unsigned int iomem_size;
 	int i, ret;
 
 	/* stop if shared driver failed, assume driver->probe will be
@@ -1619,13 +1618,13 @@ static int bcm_enet_probe(struct platfor
 	if (ret)
 		goto out;
 
-	iomem_size = resource_size(res_mem);
-	if (!request_mem_region(res_mem->start, iomem_size, "bcm63xx_enet")) {
+	if (!request_mem_region(res_mem->start, resource_size(res_mem),
+				"bcm63xx_enet")) {
 		ret = -EBUSY;
 		goto out;
 	}
 
-	priv->base = ioremap(res_mem->start, iomem_size);
+	priv->base = ioremap(res_mem->start, resource_size(res_mem));
 	if (priv->base == NULL) {
 		ret = -ENOMEM;
 		goto out_release_mem;
@@ -1831,7 +1830,7 @@ out_unmap:
 	iounmap(priv->base);
 
 out_release_mem:
-	release_mem_region(res_mem->start, iomem_size);
+	release_mem_region(res_mem->start, resource_size(res_mem));
 out:
 	free_netdev(dev);
 	return ret;
@@ -1903,19 +1902,18 @@ struct platform_driver bcm63xx_enet_driv
 static int bcm_enet_shared_probe(struct platform_device *pdev)
 {
 	struct resource *res;
-	unsigned int iomem_size;
 
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	if (!res)
 		return -ENODEV;
 
-	iomem_size = resource_size(res);
-	if (!request_mem_region(res->start, iomem_size, "bcm63xx_enet_dma"))
+	if (!request_mem_region(res->start, resource_size(res),
+				"bcm63xx_enet_dma"))
 		return -EBUSY;
 
-	bcm_enet_shared_base = ioremap(res->start, iomem_size);
+	bcm_enet_shared_base = ioremap(res->start, resource_size(res));
 	if (!bcm_enet_shared_base) {
-		release_mem_region(res->start, iomem_size);
+		release_mem_region(res->start, resource_size(res));
 		return -ENOMEM;
 	}
 	return 0;