Skip to contentSkip to conversation

i2c: busses: i2c-ocores: switch to devm_request_and_ioremap

PATCH In review Maxin B. John 3 participants 5 messages Sep 23, 2012 – Nov 13, 2012

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

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.

---

drivers/i2c/busses/i2c-ocores.c +2 -11
index bffd550..740a89b 100644
@@ -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) {
#2 lore raw

Hi Peter,

Quoted 8 lines · Peter Korsgaard
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Maxin" == Maxin B John <[email protected]> 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 <[email protected]>

Is there any update on this ?

Quoted 2 lines

--
Bye, Peter Korsgaard

Best Regards,
Maxin B. John

#3 lore raw
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Maxin" == Maxin B John <[email protected]> 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 <[email protected]>

Quoted 1 line
Quoted 1 line

Maxin> Is there any update on this ?

I'm expecting Wolfram to pick it up.

Signature · 1 line
Bye, Peter Korsgaard
#4 lore raw
In reply to Maxin B. John
Quoted 3 lines · Maxin B. John

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

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

Signature · 2 lines
Pengutronix e.K.                           | Wolfram Sang                |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |