Skip to content

Commit

Permalink
USB: c67x00: use resource_size().
Browse files Browse the repository at this point in the history
Signed-off-by: Thiago Farina <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
tfarina authored and gregkh committed Mar 2, 2010
1 parent 4585ef1 commit c38b940
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions drivers/usb/c67x00/c67x00-drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -137,13 +137,13 @@ static int __devinit c67x00_drv_probe(struct platform_device *pdev)
if (!c67x00)
return -ENOMEM;

if (!request_mem_region(res->start, res->end - res->start + 1,
if (!request_mem_region(res->start, resource_size(res),
pdev->name)) {
dev_err(&pdev->dev, "Memory region busy\n");
ret = -EBUSY;
goto request_mem_failed;
}
c67x00->hpi.base = ioremap(res->start, res->end - res->start + 1);
c67x00->hpi.base = ioremap(res->start, resource_size(res));
if (!c67x00->hpi.base) {
dev_err(&pdev->dev, "Unable to map HPI registers\n");
ret = -EIO;
Expand Down Expand Up @@ -182,7 +182,7 @@ static int __devinit c67x00_drv_probe(struct platform_device *pdev)
request_irq_failed:
iounmap(c67x00->hpi.base);
map_failed:
release_mem_region(res->start, res->end - res->start + 1);
release_mem_region(res->start, resource_size(res));
request_mem_failed:
kfree(c67x00);

Expand All @@ -208,7 +208,7 @@ static int __devexit c67x00_drv_remove(struct platform_device *pdev)

res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (res)
release_mem_region(res->start, res->end - res->start + 1);
release_mem_region(res->start, resource_size(res));

kfree(c67x00);

Expand Down

0 comments on commit c38b940

Please sign in to comment.