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

From: Tushar Behera
Date: Fri Nov 23 2012 - 01:05:36 EST


Signed-off-by: Tushar Behera <tushar.behera@xxxxxxxxxx>
---
drivers/i2c/busses/i2c-s3c2410.c | 12 +++---------
1 files changed, 3 insertions(+), 9 deletions(-)

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;
}
--
1.7.4.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/