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 /sound/aoa | |
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 'sound/aoa')
-rw-r--r-- | sound/aoa/soundbus/i2sbus/core.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/sound/aoa/soundbus/i2sbus/core.c b/sound/aoa/soundbus/i2sbus/core.c index 3ff8cc5f487a..010658335881 100644 --- a/sound/aoa/soundbus/i2sbus/core.c +++ b/sound/aoa/soundbus/i2sbus/core.c | |||
@@ -262,8 +262,7 @@ static int i2sbus_add_dev(struct macio_dev *macio, | |||
262 | */ | 262 | */ |
263 | dev->allocated_resource[i] = | 263 | dev->allocated_resource[i] = |
264 | request_mem_region(dev->resources[i].start, | 264 | request_mem_region(dev->resources[i].start, |
265 | dev->resources[i].end - | 265 | resource_size(&dev->resources[i]), |
266 | dev->resources[i].start + 1, | ||
267 | dev->rnames[i]); | 266 | dev->rnames[i]); |
268 | if (!dev->allocated_resource[i]) { | 267 | if (!dev->allocated_resource[i]) { |
269 | printk(KERN_ERR "i2sbus: failed to claim resource %d!\n", i); | 268 | printk(KERN_ERR "i2sbus: failed to claim resource %d!\n", i); |
@@ -272,19 +271,19 @@ static int i2sbus_add_dev(struct macio_dev *macio, | |||
272 | } | 271 | } |
273 | 272 | ||
274 | r = &dev->resources[aoa_resource_i2smmio]; | 273 | r = &dev->resources[aoa_resource_i2smmio]; |
275 | rlen = r->end - r->start + 1; | 274 | rlen = resource_size(r); |
276 | if (rlen < sizeof(struct i2s_interface_regs)) | 275 | if (rlen < sizeof(struct i2s_interface_regs)) |
277 | goto err; | 276 | goto err; |
278 | dev->intfregs = ioremap(r->start, rlen); | 277 | dev->intfregs = ioremap(r->start, rlen); |
279 | 278 | ||
280 | r = &dev->resources[aoa_resource_txdbdma]; | 279 | r = &dev->resources[aoa_resource_txdbdma]; |
281 | rlen = r->end - r->start + 1; | 280 | rlen = resource_size(r); |
282 | if (rlen < sizeof(struct dbdma_regs)) | 281 | if (rlen < sizeof(struct dbdma_regs)) |
283 | goto err; | 282 | goto err; |
284 | dev->out.dbdma = ioremap(r->start, rlen); | 283 | dev->out.dbdma = ioremap(r->start, rlen); |
285 | 284 | ||
286 | r = &dev->resources[aoa_resource_rxdbdma]; | 285 | r = &dev->resources[aoa_resource_rxdbdma]; |
287 | rlen = r->end - r->start + 1; | 286 | rlen = resource_size(r); |
288 | if (rlen < sizeof(struct dbdma_regs)) | 287 | if (rlen < sizeof(struct dbdma_regs)) |
289 | goto err; | 288 | goto err; |
290 | dev->in.dbdma = ioremap(r->start, rlen); | 289 | dev->in.dbdma = ioremap(r->start, rlen); |