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

* Re: [PATCH 2/2] i2c: busses: i2c-ocores: switch to devm_request_and_ioremap
       [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-11-13 11:20   ` Wolfram Sang
  1 sibling, 1 reply; 5+ messages in thread
From: Peter Korsgaard @ 2012-09-23 18:22 UTC (permalink / raw)
  To: Maxin B. John
  Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA, Rob Herring,
	Wolfram Sang (embedded platforms),
	linux-i2c-u79uwXL29TY76Z2rM5mHXA, Ben Dooks (embedded platforms),
	Jean Delvare (PC drivers, core)

>>>>> "Maxin" == Maxin B John <maxin.john-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:

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

 Maxin> Signed-off-by: Maxin B. John <maxin.john-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>

Acked-by: Peter Korsgaard <jacmet-OfajU3CKLf1/SzgSGea1oA@public.gmane.org>

-- 
Bye, Peter Korsgaard

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

* Re: [PATCH 2/2] i2c: busses: i2c-ocores: switch to devm_request_and_ioremap
       [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>
  0 siblings, 1 reply; 5+ messages in thread
From: Maxin B John @ 2012-10-09  9:13 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)

Hi Peter,

On Sun, Sep 23, 2012 at 2:22 PM, Peter Korsgaard <jacmet-OfajU3CKLf1/SzgSGea1oA@public.gmane.org> wrote:
>>>>>> "Maxin" == Maxin B John <maxin.john-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:
>
>  Maxin> This drops a few lines of code and allows common APIs to handle
>  Maxin> those for us.
>
>  Maxin> Signed-off-by: Maxin B. John <maxin.john-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
>
> Acked-by: Peter Korsgaard <jacmet-OfajU3CKLf1/SzgSGea1oA@public.gmane.org>

Is there any update on this ?

> --
> Bye, Peter Korsgaard

Best Regards,
Maxin B. John

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

* Re: [PATCH 2/2] i2c: busses: i2c-ocores: switch to devm_request_and_ioremap
       [not found]         ` <CAMhs6YztTFh0fQFfJOwc++fr-xXxEJU5KvcSvOcAcyyDgWOBDQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2012-10-09  9:29           ` Peter Korsgaard
  0 siblings, 0 replies; 5+ messages in thread
From: Peter Korsgaard @ 2012-10-09  9:29 UTC (permalink / raw)
  To: Maxin B John
  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)

>>>>> "Maxin" == Maxin B John <maxin.john-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:

 Maxin> Hi Peter,

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

 Maxin> Signed-off-by: Maxin B. John <maxin.john-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>

 >> Acked-by: Peter Korsgaard <jacmet-OfajU3CKLf1/SzgSGea1oA@public.gmane.org>

 Maxin> Is there any update on this ?

I'm expecting Wolfram to pick it up.

-- 
Bye, Peter Korsgaard

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

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

[-- Attachment #1: Type: text/plain, Size: 483 bytes --]

On Sun, Sep 23, 2012 at 09:33:58AM -0400, Maxin B. John wrote:
> 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>

Thanks, I just applied a very similar patch by Thierry Reding which was
sent earlier.

-- 
Pengutronix e.K.                           | Wolfram Sang                |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[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).