diff mbox

[3/7] i2c: s3c2410: Convert to use devm_request_mem_region()

Message ID 1353650353-17576-4-git-send-email-tushar.behera@linaro.org
State Superseded
Headers show

Commit Message

Tushar Behera Nov. 23, 2012, 5:59 a.m. UTC
Signed-off-by: Tushar Behera <tushar.behera@linaro.org>
---
 drivers/i2c/busses/i2c-s3c2410.c |   12 +++---------
 1 files changed, 3 insertions(+), 9 deletions(-)
diff mbox

Patch

diff --git a/drivers/i2c/busses/i2c-s3c2410.c b/drivers/i2c/busses/i2c-s3c2410.c
index 019c3d7..a274ef7 100644
--- a/drivers/i2c/busses/i2c-s3c2410.c
+++ b/drivers/i2c/busses/i2c-s3c2410.c
@@ -987,8 +987,8 @@  static int s3c24xx_i2c_probe(struct platform_device *pdev)
 		goto err_clk;
 	}
 
-	i2c->ioarea = request_mem_region(res->start, resource_size(res),
-					 pdev->name);
+	i2c->ioarea = devm_request_mem_region(&pdev->dev, res->start,
+					      resource_size(res), pdev->name);
 
 	if (i2c->ioarea == NULL) {
 		dev_err(&pdev->dev, "cannot request IO\n");
@@ -1001,7 +1001,7 @@  static int s3c24xx_i2c_probe(struct platform_device *pdev)
 	if (i2c->regs == NULL) {
 		dev_err(&pdev->dev, "cannot map IO\n");
 		ret = -ENXIO;
-		goto err_ioarea;
+		goto err_clk;
 	}
 
 	dev_dbg(&pdev->dev, "registers %p (%p, %p)\n",
@@ -1076,10 +1076,6 @@  static int s3c24xx_i2c_probe(struct platform_device *pdev)
  err_iomap:
 	iounmap(i2c->regs);
 
- err_ioarea:
-	release_resource(i2c->ioarea);
-	kfree(i2c->ioarea);
-
  err_clk:
 	clk_disable_unprepare(i2c->clk);
 	return ret;
@@ -1106,9 +1102,7 @@  static int s3c24xx_i2c_remove(struct platform_device *pdev)
 
 	iounmap(i2c->regs);
 
-	release_resource(i2c->ioarea);
 	s3c24xx_i2c_dt_gpio_free(i2c);
-	kfree(i2c->ioarea);
 
 	return 0;
 }