[media] drivers: staging: davinci_vpfe: use resource_size()
authorSilviu-Mihai Popescu <silviupopescu1990@gmail.com>
Mon, 18 Mar 2013 18:06:20 +0000 (15:06 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Sat, 23 Mar 2013 14:35:44 +0000 (11:35 -0300)
This uses the resource_size() function instead of explicit computation.

Signed-off-by: Silviu-Mihai Popescu <silviupopescu1990@gmail.com>
Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/staging/media/davinci_vpfe/dm365_ipipe.c
drivers/staging/media/davinci_vpfe/dm365_isif.c
drivers/staging/media/davinci_vpfe/dm365_resizer.c

index 92853539cc0a4ea5516a70b2305ef62e2b37d396..05673ed45ce4ca4c113bd221fbb6c3bae9da040c 100644 (file)
@@ -1859,5 +1859,5 @@ void vpfe_ipipe_cleanup(struct vpfe_ipipe_device *ipipe,
        iounmap(ipipe->isp5_base_addr);
        res = platform_get_resource(pdev, IORESOURCE_MEM, 4);
        if (res)
-               release_mem_region(res->start, res->end - res->start + 1);
+               release_mem_region(res->start, resource_size(res));
 }
index ebeea72e176a49b586263f8224b614320187d789..c4a56608685615ed57b9f73d193293fba62ba907 100644 (file)
@@ -1953,7 +1953,7 @@ static void isif_remove(struct vpfe_isif_device *isif,
                res = platform_get_resource(pdev, IORESOURCE_MEM, i);
                if (res)
                        release_mem_region(res->start,
-                                          res->end - res->start + 1);
+                                          resource_size(res));
                i++;
        }
 }
@@ -2003,7 +2003,7 @@ int vpfe_isif_init(struct vpfe_isif_device *isif, struct platform_device *pdev)
                        status = -ENOENT;
                        goto fail_nobase_res;
                }
-               res_len = res->end - res->start + 1;
+               res_len = resource_size(res);
                res = request_mem_region(res->start, res_len, res->name);
                if (!res) {
                        status = -EBUSY;
index 9cb0262b9b33551eeacb33ef7e07d0b2dd872d6c..126f84c4cb6466beb8286af04055eaa93fc4a408 100644 (file)
@@ -1995,5 +1995,5 @@ vpfe_resizer_cleanup(struct vpfe_resizer_device *vpfe_rsz,
        res = platform_get_resource(pdev, IORESOURCE_MEM, 5);
        if (res)
                release_mem_region(res->start,
-                                       res->end - res->start + 1);
+                                       resource_size(res));
 }