goto err_free_clk;
}
- res = request_mem_region(res->start, res->end - res->start + 1,
+ res = request_mem_region(res->start, resource_size(res),
pdev->name);
if (res == NULL) {
dev_err(&pdev->dev, "failed to request memory resource\n");
ssp->phys_base = res->start;
- ssp->mmio_base = ioremap(res->start, res->end - res->start + 1);
+ ssp->mmio_base = ioremap(res->start, resource_size(res));
if (ssp->mmio_base == NULL) {
dev_err(&pdev->dev, "failed to ioremap() registers\n");
ret = -ENODEV;
err_free_io:
iounmap(ssp->mmio_base);
err_free_mem:
- release_mem_region(res->start, res->end - res->start + 1);
+ release_mem_region(res->start, resource_size(res));
err_free_clk:
clk_put(ssp->clk);
err_free:
iounmap(ssp->mmio_base);
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- release_mem_region(res->start, res->end - res->start + 1);
+ release_mem_region(res->start, resource_size(res));
clk_put(ssp->clk);