aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Reding <thierry.reding@avionic-design.de>2012-08-08 02:54:32 -0400
committerWolfram Sang <w.sang@pengutronix.de>2012-11-13 06:16:24 -0500
commit970d494c323826d8bb21e8ed1796da15082808ec (patch)
tree406f14c7402af1b5b01e88153eeb87163f70228f
parent45fd5e4ad2052101b4ceda5fdf4b003c428ebdfc (diff)
i2c: ocores: Use devm_request_and_ioremap()
Replacing the devm_request_mem_region() and devm_ioremap_nocache() calls by a single call to devm_request_and_ioremap() simplifies the code. Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de> Acked-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
-rw-r--r--drivers/i2c/busses/i2c-ocores.c15
1 files changed, 3 insertions, 12 deletions
diff --git a/drivers/i2c/busses/i2c-ocores.c b/drivers/i2c/busses/i2c-ocores.c
index bffd5501ac2d..1fad4aeb7902 100644
--- a/drivers/i2c/busses/i2c-ocores.c
+++ b/drivers/i2c/busses/i2c-ocores.c
@@ -283,18 +283,9 @@ static int __devinit ocores_i2c_probe(struct platform_device *pdev)
283 if (!i2c) 283 if (!i2c)
284 return -ENOMEM; 284 return -ENOMEM;
285 285
286 if (!devm_request_mem_region(&pdev->dev, res->start, 286 i2c->base = devm_request_and_ioremap(&pdev->dev, res);
287 resource_size(res), pdev->name)) { 287 if (!i2c->base)
288 dev_err(&pdev->dev, "Memory region busy\n"); 288 return -EADDRNOTAVAIL;
289 return -EBUSY;
290 }
291
292 i2c->base = devm_ioremap_nocache(&pdev->dev, res->start,
293 resource_size(res));
294 if (!i2c->base) {
295 dev_err(&pdev->dev, "Unable to map registers\n");
296 return -EIO;
297 }
298 289
299 pdata = pdev->dev.platform_data; 290 pdata = pdev->dev.platform_data;
300 if (pdata) { 291 if (pdata) {