diff options
author | Joe Perches <joe@perches.com> | 2011-06-09 12:13:32 -0400 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2011-06-10 08:55:36 -0400 |
commit | 28f65c11f2ffb3957259dece647a24f8ad2e241b (patch) | |
tree | 6b7621d09d10df89eedd908d4506fb9f457a909f /drivers/usb/host/ohci-tmio.c | |
parent | 140a1ef2f91a00e1d25f0878c193abdc25bf6ebe (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-tmio.c')
-rw-r--r-- | drivers/usb/host/ohci-tmio.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/usb/host/ohci-tmio.c b/drivers/usb/host/ohci-tmio.c index 3558491dd87d..57ad1271fc9b 100644 --- a/drivers/usb/host/ohci-tmio.c +++ b/drivers/usb/host/ohci-tmio.c | |||
@@ -208,13 +208,13 @@ static int __devinit ohci_hcd_tmio_drv_probe(struct platform_device *dev) | |||
208 | } | 208 | } |
209 | 209 | ||
210 | hcd->rsrc_start = regs->start; | 210 | hcd->rsrc_start = regs->start; |
211 | hcd->rsrc_len = regs->end - regs->start + 1; | 211 | hcd->rsrc_len = resource_size(regs); |
212 | 212 | ||
213 | tmio = hcd_to_tmio(hcd); | 213 | tmio = hcd_to_tmio(hcd); |
214 | 214 | ||
215 | spin_lock_init(&tmio->lock); | 215 | spin_lock_init(&tmio->lock); |
216 | 216 | ||
217 | tmio->ccr = ioremap(config->start, config->end - config->start + 1); | 217 | tmio->ccr = ioremap(config->start, resource_size(config)); |
218 | if (!tmio->ccr) { | 218 | if (!tmio->ccr) { |
219 | ret = -ENOMEM; | 219 | ret = -ENOMEM; |
220 | goto err_ioremap_ccr; | 220 | goto err_ioremap_ccr; |
@@ -228,7 +228,7 @@ static int __devinit ohci_hcd_tmio_drv_probe(struct platform_device *dev) | |||
228 | 228 | ||
229 | if (!dma_declare_coherent_memory(&dev->dev, sram->start, | 229 | if (!dma_declare_coherent_memory(&dev->dev, sram->start, |
230 | sram->start, | 230 | sram->start, |
231 | sram->end - sram->start + 1, | 231 | resource_size(sram), |
232 | DMA_MEMORY_MAP | DMA_MEMORY_EXCLUSIVE)) { | 232 | DMA_MEMORY_MAP | DMA_MEMORY_EXCLUSIVE)) { |
233 | ret = -EBUSY; | 233 | ret = -EBUSY; |
234 | goto err_dma_declare; | 234 | goto err_dma_declare; |