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/video/msm | |
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/video/msm')
-rw-r--r-- | drivers/video/msm/mdp.c | 3 | ||||
-rw-r--r-- | drivers/video/msm/msm_fb.c | 7 |
2 files changed, 4 insertions, 6 deletions
diff --git a/drivers/video/msm/mdp.c b/drivers/video/msm/mdp.c index c3636d55a3c5..243d16f09b8a 100644 --- a/drivers/video/msm/mdp.c +++ b/drivers/video/msm/mdp.c | |||
@@ -406,8 +406,7 @@ int mdp_probe(struct platform_device *pdev) | |||
406 | goto error_get_irq; | 406 | goto error_get_irq; |
407 | } | 407 | } |
408 | 408 | ||
409 | mdp->base = ioremap(resource->start, | 409 | mdp->base = ioremap(resource->start, resource_size(resource)); |
410 | resource->end - resource->start); | ||
411 | if (mdp->base == 0) { | 410 | if (mdp->base == 0) { |
412 | printk(KERN_ERR "msmfb: cannot allocate mdp regs!\n"); | 411 | printk(KERN_ERR "msmfb: cannot allocate mdp regs!\n"); |
413 | ret = -ENOMEM; | 412 | ret = -ENOMEM; |
diff --git a/drivers/video/msm/msm_fb.c b/drivers/video/msm/msm_fb.c index ec351309e607..c6e3b4fcdd68 100644 --- a/drivers/video/msm/msm_fb.c +++ b/drivers/video/msm/msm_fb.c | |||
@@ -525,10 +525,9 @@ static int setup_fbmem(struct msmfb_info *msmfb, struct platform_device *pdev) | |||
525 | return -ENOMEM; | 525 | return -ENOMEM; |
526 | } | 526 | } |
527 | fb->fix.smem_start = resource->start; | 527 | fb->fix.smem_start = resource->start; |
528 | fb->fix.smem_len = resource->end - resource->start; | 528 | fb->fix.smem_len = resource_size(resource); |
529 | fbram = ioremap(resource->start, | 529 | fbram = ioremap(resource->start, resource_size(resource)); |
530 | resource->end - resource->start); | 530 | if (fbram == NULL) { |
531 | if (fbram == 0) { | ||
532 | printk(KERN_ERR "msmfb: cannot allocate fbram!\n"); | 531 | printk(KERN_ERR "msmfb: cannot allocate fbram!\n"); |
533 | return -ENOMEM; | 532 | return -ENOMEM; |
534 | } | 533 | } |