Skip to contentSkip to conversation

soc/bman: Use resource_size instead of computation

PATCH New Wei Yongjun 1 participant 1 message Oct 17, 2016 Freescale SoC drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 soc/bman: Use resource_size instead of computation

From: Wei Yongjun <[email protected]>

Use resource_size function on resource object
instead of explicit computation.

Generated by: scripts/coccinelle/api/resource_size.cocci

---
 drivers/soc/fsl/qbman/bman_ccsr.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/soc/fsl/qbman/bman_ccsr.c +1 -2
index 9deb052..a8e8389 100644
@@ -181,8 +181,7 @@ static int fsl_bman_probe(struct platform_device *pdev)
 			node->full_name);
 		return -ENXIO;
 	}
-	bm_ccsr_start = devm_ioremap(dev, res->start,
-				     res->end - res->start + 1);
+	bm_ccsr_start = devm_ioremap(dev, res->start, resource_size(res));
 	if (!bm_ccsr_start)
 		return -ENXIO;