diff options
author | Philipp Zabel <philipp.zabel@gmail.com> | 2009-06-05 12:31:04 -0400 |
---|---|---|
committer | Samuel Ortiz <sameol@linux.intel.com> | 2009-06-17 13:41:44 -0400 |
commit | be584bd5a451ebe31ac9957098bb698cefbd40ca (patch) | |
tree | 14fdba2f040755967bb8e95a7219b7f1eeb23ba0 /drivers/mfd | |
parent | 01906d6d780e84c51537f6b56da472959e846314 (diff) |
mfd: asic3: use resource_size macro instead of local variable
This should make the code a little bit easier to read.
Signed-off-by: Philipp Zabel <philipp.zabel@gmail.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'drivers/mfd')
-rw-r--r-- | drivers/mfd/asic3.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/mfd/asic3.c b/drivers/mfd/asic3.c index ebe889392b6d..d5dd0dfae872 100644 --- a/drivers/mfd/asic3.c +++ b/drivers/mfd/asic3.c | |||
@@ -623,7 +623,6 @@ static int __init asic3_probe(struct platform_device *pdev) | |||
623 | struct asic3 *asic; | 623 | struct asic3 *asic; |
624 | struct resource *mem; | 624 | struct resource *mem; |
625 | unsigned long clksel; | 625 | unsigned long clksel; |
626 | int map_size; | ||
627 | int ret = 0; | 626 | int ret = 0; |
628 | 627 | ||
629 | asic = kzalloc(sizeof(struct asic3), GFP_KERNEL); | 628 | asic = kzalloc(sizeof(struct asic3), GFP_KERNEL); |
@@ -643,8 +642,7 @@ static int __init asic3_probe(struct platform_device *pdev) | |||
643 | goto out_free; | 642 | goto out_free; |
644 | } | 643 | } |
645 | 644 | ||
646 | map_size = mem->end - mem->start + 1; | 645 | asic->mapping = ioremap(mem->start, resource_size(mem)); |
647 | asic->mapping = ioremap(mem->start, map_size); | ||
648 | if (!asic->mapping) { | 646 | if (!asic->mapping) { |
649 | ret = -ENOMEM; | 647 | ret = -ENOMEM; |
650 | dev_err(asic->dev, "Couldn't ioremap\n"); | 648 | dev_err(asic->dev, "Couldn't ioremap\n"); |
@@ -654,7 +652,7 @@ static int __init asic3_probe(struct platform_device *pdev) | |||
654 | asic->irq_base = pdata->irq_base; | 652 | asic->irq_base = pdata->irq_base; |
655 | 653 | ||
656 | /* calculate bus shift from mem resource */ | 654 | /* calculate bus shift from mem resource */ |
657 | asic->bus_shift = 2 - (map_size >> 12); | 655 | asic->bus_shift = 2 - (resource_size(mem) >> 12); |
658 | 656 | ||
659 | clksel = 0; | 657 | clksel = 0; |
660 | asic3_write_register(asic, ASIC3_OFFSET(CLOCK, SEL), clksel); | 658 | asic3_write_register(asic, ASIC3_OFFSET(CLOCK, SEL), clksel); |