From 8381fc35244dbdf58cfc49e04e0d7c3498c8aa03 Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Thu, 6 May 2010 11:58:55 +0200 Subject: [PATCH] dmaengine: mpc512x: Use resource_size 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 Signed-off-by: Dan Williams --- drivers/dma/mpc512x_dma.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/dma/mpc512x_dma.c b/drivers/dma/mpc512x_dma.c index 7a750b95303c..e41fb8b671d3 100644 --- a/drivers/dma/mpc512x_dma.c +++ b/drivers/dma/mpc512x_dma.c @@ -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"); -- 2.20.1