mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-27 19:29:37 +00:00
drivers/ide/au1xxx-ide.c: use resource_size()
Use resource_size() for {request/release}_mem_region and ioremap. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
a531cd69ad
commit
4b7c7237c0
1 changed files with 3 additions and 4 deletions
|
@ -532,14 +532,13 @@ static int au_ide_probe(struct platform_device *dev)
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!request_mem_region(res->start, res->end - res->start + 1,
|
if (!request_mem_region(res->start, resource_size(res), dev->name)) {
|
||||||
dev->name)) {
|
|
||||||
pr_debug("%s: request_mem_region failed\n", DRV_NAME);
|
pr_debug("%s: request_mem_region failed\n", DRV_NAME);
|
||||||
ret = -EBUSY;
|
ret = -EBUSY;
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
ahwif->regbase = (u32)ioremap(res->start, res->end - res->start + 1);
|
ahwif->regbase = (u32)ioremap(res->start, resource_size(res));
|
||||||
if (ahwif->regbase == 0) {
|
if (ahwif->regbase == 0) {
|
||||||
ret = -ENOMEM;
|
ret = -ENOMEM;
|
||||||
goto out;
|
goto out;
|
||||||
|
@ -575,7 +574,7 @@ static int au_ide_remove(struct platform_device *dev)
|
||||||
iounmap((void *)ahwif->regbase);
|
iounmap((void *)ahwif->regbase);
|
||||||
|
|
||||||
res = platform_get_resource(dev, IORESOURCE_MEM, 0);
|
res = platform_get_resource(dev, IORESOURCE_MEM, 0);
|
||||||
release_mem_region(res->start, res->end - res->start + 1);
|
release_mem_region(res->start, resource_size(res));
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue