[WATCHDOG] use resource_size()
Use resource_size(). Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Kevin Hilman <khilman@deeprootsystems.com> Cc: Kevin Hilman <khilman@ti.deeprootsystems.com> Cc: Ulrik Bech Hald <ubh@ti.com> Cc: Henrique de Moraes Holschuh <hmh@hmh.eng.br> Cc: Ming Lei <tom.leiming@gmail.com> Cc: Vincent Sanders <support@simtec.co.uk> Acked-by: Thierry Reding <thierry.reding@avionic-design.de> Signed-off-by: Wim Van Sebroeck <wim@iguana.be> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
This commit is contained in:
Родитель
4946f8353d
Коммит
b782a56375
|
@ -242,14 +242,14 @@ static int __devinit adx_wdt_probe(struct platform_device *pdev)
|
|||
}
|
||||
|
||||
res = devm_request_mem_region(&pdev->dev, res->start,
|
||||
res->end - res->start + 1, res->name);
|
||||
resource_size(res), res->name);
|
||||
if (!res) {
|
||||
dev_err(&pdev->dev, "cannot request I/O memory region\n");
|
||||
return -ENXIO;
|
||||
}
|
||||
|
||||
wdt->base = devm_ioremap_nocache(&pdev->dev, res->start,
|
||||
res->end - res->start + 1);
|
||||
resource_size(res));
|
||||
if (!wdt->base) {
|
||||
dev_err(&pdev->dev, "cannot remap I/O memory region\n");
|
||||
return -ENXIO;
|
||||
|
|
|
@ -326,7 +326,7 @@ static int __init at32_wdt_probe(struct platform_device *pdev)
|
|||
return -ENOMEM;
|
||||
}
|
||||
|
||||
wdt->regs = ioremap(regs->start, regs->end - regs->start + 1);
|
||||
wdt->regs = ioremap(regs->start, resource_size(regs));
|
||||
if (!wdt->regs) {
|
||||
ret = -ENOMEM;
|
||||
dev_dbg(&pdev->dev, "could not map I/O memory\n");
|
||||
|
|
|
@ -221,7 +221,7 @@ static int __devinit davinci_wdt_probe(struct platform_device *pdev)
|
|||
return -ENOENT;
|
||||
}
|
||||
|
||||
size = res->end - res->start + 1;
|
||||
size = resource_size(res);
|
||||
wdt_mem = request_mem_region(res->start, size, pdev->name);
|
||||
|
||||
if (wdt_mem == NULL) {
|
||||
|
|
|
@ -350,7 +350,7 @@ static int __devinit mpcore_wdt_probe(struct platform_device *dev)
|
|||
ret = -ENXIO;
|
||||
goto err_free;
|
||||
}
|
||||
wdt->base = ioremap(res->start, res->end - res->start + 1);
|
||||
wdt->base = ioremap(res->start, resource_size(res));
|
||||
if (!wdt->base) {
|
||||
ret = -ENOMEM;
|
||||
goto err_free;
|
||||
|
|
|
@ -275,7 +275,7 @@ static int __devinit mv64x60_wdt_probe(struct platform_device *dev)
|
|||
if (!r)
|
||||
return -ENODEV;
|
||||
|
||||
mv64x60_wdt_regs = ioremap(r->start, r->end - r->start + 1);
|
||||
mv64x60_wdt_regs = ioremap(r->start, resource_size(r));
|
||||
if (mv64x60_wdt_regs == NULL)
|
||||
return -ENOMEM;
|
||||
|
||||
|
|
|
@ -277,8 +277,7 @@ static int __devinit omap_wdt_probe(struct platform_device *pdev)
|
|||
goto err_busy;
|
||||
}
|
||||
|
||||
mem = request_mem_region(res->start, res->end - res->start + 1,
|
||||
pdev->name);
|
||||
mem = request_mem_region(res->start, resource_size(res), pdev->name);
|
||||
if (!mem) {
|
||||
ret = -EBUSY;
|
||||
goto err_busy;
|
||||
|
@ -306,7 +305,7 @@ static int __devinit omap_wdt_probe(struct platform_device *pdev)
|
|||
goto err_clk;
|
||||
}
|
||||
|
||||
wdev->base = ioremap(res->start, res->end - res->start + 1);
|
||||
wdev->base = ioremap(res->start, resource_size(res));
|
||||
if (!wdev->base) {
|
||||
ret = -ENOMEM;
|
||||
goto err_ioremap;
|
||||
|
@ -358,7 +357,7 @@ err_clk:
|
|||
kfree(wdev);
|
||||
|
||||
err_kzalloc:
|
||||
release_mem_region(res->start, res->end - res->start + 1);
|
||||
release_mem_region(res->start, resource_size(res));
|
||||
|
||||
err_busy:
|
||||
err_get_resource:
|
||||
|
@ -383,7 +382,7 @@ static int __devexit omap_wdt_remove(struct platform_device *pdev)
|
|||
return -ENOENT;
|
||||
|
||||
misc_deregister(&(wdev->omap_wdt_miscdev));
|
||||
release_mem_region(res->start, res->end - res->start + 1);
|
||||
release_mem_region(res->start, resource_size(res));
|
||||
platform_set_drvdata(pdev, NULL);
|
||||
|
||||
clk_put(wdev->ick);
|
||||
|
|
|
@ -264,7 +264,7 @@ static int __devinit pnx4008_wdt_probe(struct platform_device *pdev)
|
|||
return -ENOENT;
|
||||
}
|
||||
|
||||
size = res->end - res->start + 1;
|
||||
size = resource_size(res);
|
||||
wdt_mem = request_mem_region(res->start, size, pdev->name);
|
||||
|
||||
if (wdt_mem == NULL) {
|
||||
|
|
|
@ -421,7 +421,7 @@ static int __devinit s3c2410wdt_probe(struct platform_device *pdev)
|
|||
return -ENOENT;
|
||||
}
|
||||
|
||||
size = (res->end - res->start) + 1;
|
||||
size = resource_size(res);
|
||||
wdt_mem = request_mem_region(res->start, size, pdev->name);
|
||||
if (wdt_mem == NULL) {
|
||||
dev_err(dev, "failed to get memory region\n");
|
||||
|
|
|
@ -214,12 +214,10 @@ static int __init txx9wdt_probe(struct platform_device *dev)
|
|||
res = platform_get_resource(dev, IORESOURCE_MEM, 0);
|
||||
if (!res)
|
||||
goto exit_busy;
|
||||
if (!devm_request_mem_region(&dev->dev,
|
||||
res->start, res->end - res->start + 1,
|
||||
if (!devm_request_mem_region(&dev->dev, res->start, resource_size(res),
|
||||
"txx9wdt"))
|
||||
goto exit_busy;
|
||||
txx9wdt_reg = devm_ioremap(&dev->dev,
|
||||
res->start, res->end - res->start + 1);
|
||||
txx9wdt_reg = devm_ioremap(&dev->dev, res->start, resource_size(res));
|
||||
if (!txx9wdt_reg)
|
||||
goto exit_busy;
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче