aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/host/ohci-sm501.c
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2011-06-09 12:13:32 -0400
committerJiri Kosina <jkosina@suse.cz>2011-06-10 08:55:36 -0400
commit28f65c11f2ffb3957259dece647a24f8ad2e241b (patch)
tree6b7621d09d10df89eedd908d4506fb9f457a909f /drivers/usb/host/ohci-sm501.c
parent140a1ef2f91a00e1d25f0878c193abdc25bf6ebe (diff)
treewide: Convert uses of struct resource to resource_size(ptr)
Several fixes as well where the +1 was missing. Done via coccinelle scripts like: @@ struct resource *ptr; @@ - ptr->end - ptr->start + 1 + resource_size(ptr) and some grep and typing. Mostly uncompiled, no cross-compilers. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/usb/host/ohci-sm501.c')
-rw-r--r--drivers/usb/host/ohci-sm501.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/drivers/usb/host/ohci-sm501.c b/drivers/usb/host/ohci-sm501.c
index 041d30f30c10..78918ca0da23 100644
--- a/drivers/usb/host/ohci-sm501.c
+++ b/drivers/usb/host/ohci-sm501.c
@@ -103,8 +103,7 @@ static int ohci_hcd_sm501_drv_probe(struct platform_device *pdev)
103 goto err0; 103 goto err0;
104 } 104 }
105 105
106 if (!request_mem_region(mem->start, mem->end - mem->start + 1, 106 if (!request_mem_region(mem->start, resource_size(mem), pdev->name)) {
107 pdev->name)) {
108 dev_err(dev, "request_mem_region failed\n"); 107 dev_err(dev, "request_mem_region failed\n");
109 retval = -EBUSY; 108 retval = -EBUSY;
110 goto err0; 109 goto err0;
@@ -126,7 +125,7 @@ static int ohci_hcd_sm501_drv_probe(struct platform_device *pdev)
126 125
127 if (!dma_declare_coherent_memory(dev, mem->start, 126 if (!dma_declare_coherent_memory(dev, mem->start,
128 mem->start - mem->parent->start, 127 mem->start - mem->parent->start,
129 (mem->end - mem->start) + 1, 128 resource_size(mem),
130 DMA_MEMORY_MAP | 129 DMA_MEMORY_MAP |
131 DMA_MEMORY_EXCLUSIVE)) { 130 DMA_MEMORY_EXCLUSIVE)) {
132 dev_err(dev, "cannot declare coherent memory\n"); 131 dev_err(dev, "cannot declare coherent memory\n");
@@ -149,7 +148,7 @@ static int ohci_hcd_sm501_drv_probe(struct platform_device *pdev)
149 } 148 }
150 149
151 hcd->rsrc_start = res->start; 150 hcd->rsrc_start = res->start;
152 hcd->rsrc_len = res->end - res->start + 1; 151 hcd->rsrc_len = resource_size(res);
153 152
154 if (!request_mem_region(hcd->rsrc_start, hcd->rsrc_len, pdev->name)) { 153 if (!request_mem_region(hcd->rsrc_start, hcd->rsrc_len, pdev->name)) {
155 dev_err(dev, "request_mem_region failed\n"); 154 dev_err(dev, "request_mem_region failed\n");
@@ -185,7 +184,7 @@ err3:
185err2: 184err2:
186 dma_release_declared_memory(dev); 185 dma_release_declared_memory(dev);
187err1: 186err1:
188 release_mem_region(mem->start, mem->end - mem->start + 1); 187 release_mem_region(mem->start, resource_size(mem));
189err0: 188err0:
190 return retval; 189 return retval;
191} 190}
@@ -201,7 +200,7 @@ static int ohci_hcd_sm501_drv_remove(struct platform_device *pdev)
201 dma_release_declared_memory(&pdev->dev); 200 dma_release_declared_memory(&pdev->dev);
202 mem = platform_get_resource(pdev, IORESOURCE_MEM, 1); 201 mem = platform_get_resource(pdev, IORESOURCE_MEM, 1);
203 if (mem) 202 if (mem)
204 release_mem_region(mem->start, mem->end - mem->start + 1); 203 release_mem_region(mem->start, resource_size(mem));
205 204
206 /* mask interrupts and disable power */ 205 /* mask interrupts and disable power */
207 206