public inbox for linux-kernel@vger.kernel.org
 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
  2012-09-23 18:22 ` Peter Korsgaard
  2012-11-13 11:20 ` Wolfram Sang
  0 siblings, 2 replies; 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, linux-kernel,
	devicetree-discuss, 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@gmail.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) {

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

* Re: [PATCH 2/2] i2c: busses: i2c-ocores: switch to devm_request_and_ioremap
  2012-09-23 13:33 [PATCH 2/2] i2c: busses: i2c-ocores: switch to devm_request_and_ioremap Maxin B. John
@ 2012-09-23 18:22 ` Peter Korsgaard
  2012-10-09  9:13   ` Maxin B John
  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: Ben Dooks (embedded platforms), Wolfram Sang (embedded platforms),
	Grant Likely, Rob Herring, linux-i2c, linux-kernel,
	devicetree-discuss, Jean Delvare (PC drivers, core)

>>>>> "Maxin" == Maxin B John <maxin.john@gmail.com> 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@gmail.com>

Acked-by: Peter Korsgaard <jacmet@sunsite.dk>

-- 
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
  2012-09-23 18:22 ` Peter Korsgaard
@ 2012-10-09  9:13   ` Maxin B John
  2012-10-09  9:29     ` Peter Korsgaard
  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, linux-kernel,
	devicetree-discuss, Jean Delvare (PC drivers, core)

Hi Peter,

On Sun, Sep 23, 2012 at 2:22 PM, Peter Korsgaard <jacmet@sunsite.dk> wrote:
>>>>>> "Maxin" == Maxin B John <maxin.john@gmail.com> 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@gmail.com>
>
> Acked-by: Peter Korsgaard <jacmet@sunsite.dk>

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
  2012-10-09  9:13   ` Maxin B John
@ 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, linux-kernel,
	devicetree-discuss, Jean Delvare (PC drivers, core)

>>>>> "Maxin" == Maxin B John <maxin.john@gmail.com> 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@gmail.com>

 >> Acked-by: Peter Korsgaard <jacmet@sunsite.dk>

 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
  2012-09-23 13:33 [PATCH 2/2] i2c: busses: i2c-ocores: switch to devm_request_and_ioremap Maxin B. John
  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, linux-kernel, devicetree-discuss,
	Jean Delvare (PC drivers, core)

[-- Attachment #1: Type: text/plain, Size: 453 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@gmail.com>

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
2012-09-23 18:22 ` Peter Korsgaard
2012-10-09  9:13   ` Maxin B John
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