[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20120923133358.GA22861@linux-3ix0.site>
Date: Sun, 23 Sep 2012 09:33:58 -0400
From: "Maxin B. John" <maxin.john@...il.com>
To: Peter Korsgaard <jacmet@...site.dk>
Cc: "Ben Dooks (embedded platforms)" <ben-linux@...ff.org>,
"Wolfram Sang (embedded platforms)" <w.sang@...gutronix.de>,
Grant Likely <grant.likely@...retlab.ca>,
Rob Herring <rob.herring@...xeda.com>,
linux-i2c@...r.kernel.org, linux-kernel@...r.kernel.org,
devicetree-discuss@...ts.ozlabs.org,
"Jean Delvare (PC drivers, core)" <khali@...ux-fr.org>
Subject: [PATCH 2/2] i2c: busses: i2c-ocores: switch to
devm_request_and_ioremap
This drops a few lines of code and allows common APIs to handle those for us.
Signed-off-by: Maxin B. John <maxin.john@...il.com>
---
diff --git a/drivers/i2c/busses/i2c-ocores.c b/drivers/i2c/busses/i2c-ocores.c
index bffd550..740a89b 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)
if (!i2c)
return -ENOMEM;
- if (!devm_request_mem_region(&pdev->dev, res->start,
- resource_size(res), pdev->name)) {
- dev_err(&pdev->dev, "Memory region busy\n");
+ i2c->base = devm_request_and_ioremap(&pdev->dev, res);
+ if (!i2c->base)
return -EBUSY;
- }
-
- i2c->base = devm_ioremap_nocache(&pdev->dev, res->start,
- resource_size(res));
- if (!i2c->base) {
- dev_err(&pdev->dev, "Unable to map registers\n");
- return -EIO;
- }
pdata = pdev->dev.platform_data;
if (pdata) {
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists