linux-i2c.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 2/2] i2c: busses: i2c-ocores: switch to devm_request_and_ioremap
@ 2012-09-23 13:33 Maxin B. John
       [not found] ` <20120923133358.GA22861-ks9ITDofB9nuAK1a81qwxQ@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: Maxin B. John @ 2012-09-23 13:33 UTC (permalink / raw)
  To: Peter Korsgaard
  Cc: Ben Dooks (embedded platforms), Wolfram Sang (embedded platforms),
	Grant Likely, Rob Herring, linux-i2c-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	Jean Delvare (PC drivers, core)

This drops a few lines of code and allows common APIs to handle those for us.

Signed-off-by: Maxin B. John <maxin.john-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
---
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) {

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-11-13 11:20 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-23 13:33 [PATCH 2/2] i2c: busses: i2c-ocores: switch to devm_request_and_ioremap Maxin B. John
     [not found] ` <20120923133358.GA22861-ks9ITDofB9nuAK1a81qwxQ@public.gmane.org>
2012-09-23 18:22   ` Peter Korsgaard
     [not found]     ` <874nmoa9b1.fsf-uXGAPMMVk8amE9MCos8gUmSdvHPH+/yF@public.gmane.org>
2012-10-09  9:13       ` Maxin B John
     [not found]         ` <CAMhs6YztTFh0fQFfJOwc++fr-xXxEJU5KvcSvOcAcyyDgWOBDQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-10-09  9:29           ` Peter Korsgaard
2012-11-13 11:20   ` Wolfram Sang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).