lkml.org 
[lkml]   [2009]   [Jun]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 4/7] MFD: ASIC3: use resource_size macro instead of local variable
    Date
    This should make the code a little bit easier to read.

    Signed-off-by: Philipp Zabel <philipp.zabel@gmail.com>
    ---
    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 ed7f0c1..a2a446d 100644
    --- a/drivers/mfd/asic3.c
    +++ b/drivers/mfd/asic3.c
    @@ -656,7 +656,6 @@ static int __init asic3_probe(struct platform_device *pdev)
    struct asic3 *asic;
    struct resource *mem;
    unsigned long clksel;
    - int map_size;
    int ret = 0;

    asic = kzalloc(sizeof(struct asic3), GFP_KERNEL);
    @@ -676,8 +675,7 @@ static int __init asic3_probe(struct platform_device *pdev)
    goto out_free;
    }

    - map_size = mem->end - mem->start + 1;
    - asic->mapping = ioremap(mem->start, map_size);
    + asic->mapping = ioremap(mem->start, resource_size(mem));
    if (!asic->mapping) {
    ret = -ENOMEM;
    dev_err(asic->dev, "Couldn't ioremap\n");
    @@ -687,7 +685,7 @@ static int __init asic3_probe(struct platform_device *pdev)
    asic->irq_base = pdata->irq_base;

    /* calculate bus shift from mem resource */
    - asic->bus_shift = 2 - (map_size >> 12);
    + asic->bus_shift = 2 - (resource_size(mem) >> 12);

    clksel = 0;
    asic3_write_register(asic, ASIC3_OFFSET(CLOCK, SEL), clksel);
    --
    1.6.3.1


    \
     
     \ /
      Last update: 2009-06-04 20:41    [W:0.028 / U:0.004 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site