Update the code to use devm_* API so that driver
core will manage resources.
Signed-off-by: Vishwanathrao Badarkhe, Manish <manishv.b@xxxxxx>
---
Changes since V1:
- Rebase on top of v3.8-rc6 of linus tree.
- Apply devm operation on clk_get.
:100644 100644 6a0a553... da4e218... M drivers/i2c/busses/i2c-davinci.c
drivers/i2c/busses/i2c-davinci.c | 45 +++++++++++---------------------------
1 files changed, 13 insertions(+), 32 deletions(-)
diff --git a/drivers/i2c/busses/i2c-davinci.c b/drivers/i2c/busses/i2c-davinci.c[...]
index 6a0a553..da4e218 100644
--- a/drivers/i2c/busses/i2c-davinci.c
+++ b/drivers/i2c/busses/i2c-davinci.c
@@ -699,22 +693,24 @@ static int davinci_i2c_probe(struct platform_device *pdev)
dev->pdata = &davinci_i2c_platform_data_default;
}
- dev->clk = clk_get(&pdev->dev, NULL);
+ dev->clk = devm_clk_get(&pdev->dev, NULL);
if (IS_ERR(dev->clk)) {
r = -ENODEV;
goto err_free_mem;
}
clk_prepare_enable(dev->clk);
- dev->base = ioremap(mem->start, resource_size(mem));
+ dev->base = devm_request_and_ioremap(&pdev->dev, mem);
if (!dev->base) {
r = -EBUSY;