Skip to content

Commit

Permalink
dmaengine: mpc512x: Use resource_size
Browse files Browse the repository at this point in the history
Use the resource_size function instead of manually calculating the
resource size.  This reduces the chance of introducing off-by-one
errors.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
  • Loading branch information
Tobias Klauser authored and Dan Williams committed May 17, 2010
1 parent cc05ea0 commit 8381fc3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/dma/mpc512x_dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -657,7 +657,7 @@ static int __devinit mpc_dma_probe(struct of_device *op,
}

regs_start = res.start;
regs_size = res.end - res.start + 1;
regs_size = resource_size(&res);

if (!devm_request_mem_region(dev, regs_start, regs_size, DRV_NAME)) {
dev_err(dev, "Error requesting memory region!\n");
Expand Down

0 comments on commit 8381fc3

Please sign in to comment.