2012-11-23 06:05:34

by Tushar Behera

[permalink] [raw]
Subject: [PATCH 0/7] i2c: s3c2410: Add devm_* apis and cleanup

This patchset cleans up the probe function of i2c-s3c2410 driver.
These have been tested on Exynos4210 based Origen board.

Tushar Behera (7):
i2c: s3c2410: Remove unnecessary label err_noclk
i2c: s3c2410: Convert to use devm_clk_get()
i2c: s3c2410: Convert to use devm_request_mem_region()
i2c: s3c2410: Convert to use devm_ioremap()
i2c: s3c2410: Convert to use devm_request_irq()
i2c: s3c2410: Move location of clk_prepare_enable() call in probe
function
i2c: s3c2410: Remove err_cpufreq label

drivers/i2c/busses/i2c-s3c2410.c | 74 ++++++++++++--------------------------
1 files changed, 23 insertions(+), 51 deletions(-)

--
1.7.4.1


2012-11-23 06:05:40

by Tushar Behera

[permalink] [raw]
Subject: [PATCH 1/7] i2c: s3c2410: Remove unnecessary label err_noclk

err_noclk label redirects to a simple return statement. Move the
return statement to the caller location and remove the label.

Signed-off-by: Tushar Behera <[email protected]>
---
drivers/i2c/busses/i2c-s3c2410.c | 9 +++------
1 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/i2c/busses/i2c-s3c2410.c b/drivers/i2c/busses/i2c-s3c2410.c
index 3e0335f..7522f40 100644
--- a/drivers/i2c/busses/i2c-s3c2410.c
+++ b/drivers/i2c/busses/i2c-s3c2410.c
@@ -945,8 +945,8 @@ static int s3c24xx_i2c_probe(struct platform_device *pdev)

i2c->pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL);
if (!i2c->pdata) {
- ret = -ENOMEM;
- goto err_noclk;
+ dev_err(&pdev->dev, "no memory for platform data\n");
+ return -ENOMEM;
}

i2c->quirks = s3c24xx_get_device_quirks(pdev);
@@ -971,8 +971,7 @@ static int s3c24xx_i2c_probe(struct platform_device *pdev)
i2c->clk = clk_get(&pdev->dev, "i2c");
if (IS_ERR(i2c->clk)) {
dev_err(&pdev->dev, "cannot get clock\n");
- ret = -ENOENT;
- goto err_noclk;
+ return -ENOENT;
}

dev_dbg(&pdev->dev, "clock source %p\n", i2c->clk);
@@ -1084,8 +1083,6 @@ static int s3c24xx_i2c_probe(struct platform_device *pdev)
err_clk:
clk_disable_unprepare(i2c->clk);
clk_put(i2c->clk);
-
- err_noclk:
return ret;
}

--
1.7.4.1

2012-11-23 06:05:47

by Tushar Behera

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

Signed-off-by: Tushar Behera <[email protected]>
---
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

2012-11-23 06:05:42

by Tushar Behera

[permalink] [raw]
Subject: [PATCH 2/7] i2c: s3c2410: Convert to use devm_clk_get()

Signed-off-by: Tushar Behera <[email protected]>
---
drivers/i2c/busses/i2c-s3c2410.c | 4 +---
1 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/drivers/i2c/busses/i2c-s3c2410.c b/drivers/i2c/busses/i2c-s3c2410.c
index 7522f40..019c3d7 100644
--- a/drivers/i2c/busses/i2c-s3c2410.c
+++ b/drivers/i2c/busses/i2c-s3c2410.c
@@ -968,7 +968,7 @@ static int s3c24xx_i2c_probe(struct platform_device *pdev)
/* find the clock and enable it */

i2c->dev = &pdev->dev;
- i2c->clk = clk_get(&pdev->dev, "i2c");
+ i2c->clk = devm_clk_get(&pdev->dev, "i2c");
if (IS_ERR(i2c->clk)) {
dev_err(&pdev->dev, "cannot get clock\n");
return -ENOENT;
@@ -1082,7 +1082,6 @@ static int s3c24xx_i2c_probe(struct platform_device *pdev)

err_clk:
clk_disable_unprepare(i2c->clk);
- clk_put(i2c->clk);
return ret;
}

@@ -1104,7 +1103,6 @@ static int s3c24xx_i2c_remove(struct platform_device *pdev)
free_irq(i2c->irq, i2c);

clk_disable_unprepare(i2c->clk);
- clk_put(i2c->clk);

iounmap(i2c->regs);

--
1.7.4.1

2012-11-23 06:05:52

by Tushar Behera

[permalink] [raw]
Subject: [PATCH 4/7] i2c: s3c2410: Convert to use devm_ioremap()

Signed-off-by: Tushar Behera <[email protected]>
---
drivers/i2c/busses/i2c-s3c2410.c | 13 ++++---------
1 files changed, 4 insertions(+), 9 deletions(-)

diff --git a/drivers/i2c/busses/i2c-s3c2410.c b/drivers/i2c/busses/i2c-s3c2410.c
index a274ef7..3446af2 100644
--- a/drivers/i2c/busses/i2c-s3c2410.c
+++ b/drivers/i2c/busses/i2c-s3c2410.c
@@ -996,7 +996,7 @@ static int s3c24xx_i2c_probe(struct platform_device *pdev)
goto err_clk;
}

- i2c->regs = ioremap(res->start, resource_size(res));
+ i2c->regs = devm_ioremap(&pdev->dev, res->start, resource_size(res));

if (i2c->regs == NULL) {
dev_err(&pdev->dev, "cannot map IO\n");
@@ -1016,7 +1016,7 @@ static int s3c24xx_i2c_probe(struct platform_device *pdev)

ret = s3c24xx_i2c_init(i2c);
if (ret != 0)
- goto err_iomap;
+ goto err_clk;

/* find the IRQ for this unit (note, this relies on the init call to
* ensure no current IRQs pending
@@ -1025,7 +1025,7 @@ static int s3c24xx_i2c_probe(struct platform_device *pdev)
i2c->irq = ret = platform_get_irq(pdev, 0);
if (ret <= 0) {
dev_err(&pdev->dev, "cannot find IRQ\n");
- goto err_iomap;
+ goto err_clk;
}

ret = request_irq(i2c->irq, s3c24xx_i2c_irq, 0,
@@ -1033,7 +1033,7 @@ static int s3c24xx_i2c_probe(struct platform_device *pdev)

if (ret != 0) {
dev_err(&pdev->dev, "cannot claim IRQ %d\n", i2c->irq);
- goto err_iomap;
+ goto err_clk;
}

ret = s3c24xx_i2c_register_cpufreq(i2c);
@@ -1073,9 +1073,6 @@ static int s3c24xx_i2c_probe(struct platform_device *pdev)
err_irq:
free_irq(i2c->irq, i2c);

- err_iomap:
- iounmap(i2c->regs);
-
err_clk:
clk_disable_unprepare(i2c->clk);
return ret;
@@ -1100,8 +1097,6 @@ static int s3c24xx_i2c_remove(struct platform_device *pdev)

clk_disable_unprepare(i2c->clk);

- iounmap(i2c->regs);
-
s3c24xx_i2c_dt_gpio_free(i2c);

return 0;
--
1.7.4.1

2012-11-23 06:05:56

by Tushar Behera

[permalink] [raw]
Subject: [PATCH 5/7] i2c: s3c2410: Convert to use devm_request_irq()

Signed-off-by: Tushar Behera <[email protected]>
---
drivers/i2c/busses/i2c-s3c2410.c | 10 +++-------
1 files changed, 3 insertions(+), 7 deletions(-)

diff --git a/drivers/i2c/busses/i2c-s3c2410.c b/drivers/i2c/busses/i2c-s3c2410.c
index 3446af2..3e4143c 100644
--- a/drivers/i2c/busses/i2c-s3c2410.c
+++ b/drivers/i2c/busses/i2c-s3c2410.c
@@ -1028,8 +1028,8 @@ static int s3c24xx_i2c_probe(struct platform_device *pdev)
goto err_clk;
}

- ret = request_irq(i2c->irq, s3c24xx_i2c_irq, 0,
- dev_name(&pdev->dev), i2c);
+ ret = devm_request_irq(&pdev->dev, i2c->irq, s3c24xx_i2c_irq, 0,
+ dev_name(&pdev->dev), i2c);

if (ret != 0) {
dev_err(&pdev->dev, "cannot claim IRQ %d\n", i2c->irq);
@@ -1039,7 +1039,7 @@ static int s3c24xx_i2c_probe(struct platform_device *pdev)
ret = s3c24xx_i2c_register_cpufreq(i2c);
if (ret < 0) {
dev_err(&pdev->dev, "failed to register cpufreq notifier\n");
- goto err_irq;
+ goto err_clk;
}

/* Note, previous versions of the driver used i2c_add_adapter()
@@ -1070,9 +1070,6 @@ static int s3c24xx_i2c_probe(struct platform_device *pdev)
err_cpufreq:
s3c24xx_i2c_deregister_cpufreq(i2c);

- err_irq:
- free_irq(i2c->irq, i2c);
-
err_clk:
clk_disable_unprepare(i2c->clk);
return ret;
@@ -1093,7 +1090,6 @@ static int s3c24xx_i2c_remove(struct platform_device *pdev)
s3c24xx_i2c_deregister_cpufreq(i2c);

i2c_del_adapter(&i2c->adap);
- free_irq(i2c->irq, i2c);

clk_disable_unprepare(i2c->clk);

--
1.7.4.1

2012-11-23 06:06:13

by Tushar Behera

[permalink] [raw]
Subject: [PATCH 7/7] i2c: s3c2410: Remove err_cpufreq label

err_cpufreq label is now used only once. It can be removed and related
code can be moved to the caller location.

Signed-off-by: Tushar Behera <[email protected]>
---
drivers/i2c/busses/i2c-s3c2410.c | 7 ++-----
1 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/i2c/busses/i2c-s3c2410.c b/drivers/i2c/busses/i2c-s3c2410.c
index 707efaf..c934ec8 100644
--- a/drivers/i2c/busses/i2c-s3c2410.c
+++ b/drivers/i2c/busses/i2c-s3c2410.c
@@ -1053,7 +1053,8 @@ static int s3c24xx_i2c_probe(struct platform_device *pdev)
ret = i2c_add_numbered_adapter(&i2c->adap);
if (ret < 0) {
dev_err(&pdev->dev, "failed to add bus to i2c core\n");
- goto err_cpufreq;
+ s3c24xx_i2c_deregister_cpufreq(i2c);
+ return ret;
}

of_i2c_register_devices(&i2c->adap);
@@ -1064,10 +1065,6 @@ static int s3c24xx_i2c_probe(struct platform_device *pdev)

dev_info(&pdev->dev, "%s: S3C I2C adapter\n", dev_name(&i2c->adap.dev));
return 0;
-
- err_cpufreq:
- s3c24xx_i2c_deregister_cpufreq(i2c);
- return ret;
}

/* s3c24xx_i2c_remove
--
1.7.4.1

2012-11-23 06:06:01

by Tushar Behera

[permalink] [raw]
Subject: [PATCH 6/7] i2c: s3c2410: Move location of clk_prepare_enable() call in probe function

In probe call, only s3c24xx_i2c_init() needs the I2C clock to be enabled.
Moving clk_prepare_enable() and clk_disable_unprepare() calls to around
this function simplifies the return path of probe call.

Signed-off-by: Tushar Behera <[email protected]>
---
drivers/i2c/busses/i2c-s3c2410.c | 29 ++++++++++++-----------------
1 files changed, 12 insertions(+), 17 deletions(-)

diff --git a/drivers/i2c/busses/i2c-s3c2410.c b/drivers/i2c/busses/i2c-s3c2410.c
index 3e4143c..707efaf 100644
--- a/drivers/i2c/busses/i2c-s3c2410.c
+++ b/drivers/i2c/busses/i2c-s3c2410.c
@@ -976,15 +976,13 @@ static int s3c24xx_i2c_probe(struct platform_device *pdev)

dev_dbg(&pdev->dev, "clock source %p\n", i2c->clk);

- clk_prepare_enable(i2c->clk);

/* map the registers */

res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (res == NULL) {
dev_err(&pdev->dev, "cannot find IO resource\n");
- ret = -ENOENT;
- goto err_clk;
+ return -ENOENT;
}

i2c->ioarea = devm_request_mem_region(&pdev->dev, res->start,
@@ -992,16 +990,14 @@ static int s3c24xx_i2c_probe(struct platform_device *pdev)

if (i2c->ioarea == NULL) {
dev_err(&pdev->dev, "cannot request IO\n");
- ret = -ENXIO;
- goto err_clk;
+ return -ENXIO;
}

i2c->regs = devm_ioremap(&pdev->dev, res->start, resource_size(res));

if (i2c->regs == NULL) {
dev_err(&pdev->dev, "cannot map IO\n");
- ret = -ENXIO;
- goto err_clk;
+ return -ENXIO;
}

dev_dbg(&pdev->dev, "registers %p (%p, %p)\n",
@@ -1014,10 +1010,13 @@ static int s3c24xx_i2c_probe(struct platform_device *pdev)

/* initialise the i2c controller */

+ clk_prepare_enable(i2c->clk);
ret = s3c24xx_i2c_init(i2c);
- if (ret != 0)
- goto err_clk;
-
+ clk_disable_unprepare(i2c->clk);
+ if (ret != 0) {
+ dev_err(&pdev->dev, "I2C controller init failed\n");
+ return ret;
+ }
/* find the IRQ for this unit (note, this relies on the init call to
* ensure no current IRQs pending
*/
@@ -1025,7 +1024,7 @@ static int s3c24xx_i2c_probe(struct platform_device *pdev)
i2c->irq = ret = platform_get_irq(pdev, 0);
if (ret <= 0) {
dev_err(&pdev->dev, "cannot find IRQ\n");
- goto err_clk;
+ return ret;
}

ret = devm_request_irq(&pdev->dev, i2c->irq, s3c24xx_i2c_irq, 0,
@@ -1033,13 +1032,13 @@ static int s3c24xx_i2c_probe(struct platform_device *pdev)

if (ret != 0) {
dev_err(&pdev->dev, "cannot claim IRQ %d\n", i2c->irq);
- goto err_clk;
+ return ret;
}

ret = s3c24xx_i2c_register_cpufreq(i2c);
if (ret < 0) {
dev_err(&pdev->dev, "failed to register cpufreq notifier\n");
- goto err_clk;
+ return ret;
}

/* Note, previous versions of the driver used i2c_add_adapter()
@@ -1064,14 +1063,10 @@ static int s3c24xx_i2c_probe(struct platform_device *pdev)
pm_runtime_enable(&i2c->adap.dev);

dev_info(&pdev->dev, "%s: S3C I2C adapter\n", dev_name(&i2c->adap.dev));
- clk_disable_unprepare(i2c->clk);
return 0;

err_cpufreq:
s3c24xx_i2c_deregister_cpufreq(i2c);
-
- err_clk:
- clk_disable_unprepare(i2c->clk);
return ret;
}

--
1.7.4.1

2012-11-23 06:14:51

by Sachin Kamat

[permalink] [raw]
Subject: Re: [PATCH 4/7] i2c: s3c2410: Convert to use devm_ioremap()

Hi Tushar,

On 23 November 2012 11:29, Tushar Behera <[email protected]> wrote:
> Signed-off-by: Tushar Behera <[email protected]>
> ---
> drivers/i2c/busses/i2c-s3c2410.c | 13 ++++---------
> 1 files changed, 4 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/i2c/busses/i2c-s3c2410.c b/drivers/i2c/busses/i2c-s3c2410.c
> index a274ef7..3446af2 100644
> --- a/drivers/i2c/busses/i2c-s3c2410.c
> +++ b/drivers/i2c/busses/i2c-s3c2410.c
> @@ -996,7 +996,7 @@ static int s3c24xx_i2c_probe(struct platform_device *pdev)
> goto err_clk;
> }
>
> - i2c->regs = ioremap(res->start, resource_size(res));
> + i2c->regs = devm_ioremap(&pdev->dev, res->start, resource_size(res));
>

request_mem_region and ioremap and be replaced using a single
devm_request_and_ioremap() call.

Also you may squash patches 2-5 into single convert to devm_* functions patch.


> if (i2c->regs == NULL) {
> dev_err(&pdev->dev, "cannot map IO\n");
> @@ -1016,7 +1016,7 @@ static int s3c24xx_i2c_probe(struct platform_device *pdev)
>
> ret = s3c24xx_i2c_init(i2c);
> if (ret != 0)
> - goto err_iomap;
> + goto err_clk;
>
> /* find the IRQ for this unit (note, this relies on the init call to
> * ensure no current IRQs pending
> @@ -1025,7 +1025,7 @@ static int s3c24xx_i2c_probe(struct platform_device *pdev)
> i2c->irq = ret = platform_get_irq(pdev, 0);
> if (ret <= 0) {
> dev_err(&pdev->dev, "cannot find IRQ\n");
> - goto err_iomap;
> + goto err_clk;
> }
>
> ret = request_irq(i2c->irq, s3c24xx_i2c_irq, 0,
> @@ -1033,7 +1033,7 @@ static int s3c24xx_i2c_probe(struct platform_device *pdev)
>
> if (ret != 0) {
> dev_err(&pdev->dev, "cannot claim IRQ %d\n", i2c->irq);
> - goto err_iomap;
> + goto err_clk;
> }
>
> ret = s3c24xx_i2c_register_cpufreq(i2c);
> @@ -1073,9 +1073,6 @@ static int s3c24xx_i2c_probe(struct platform_device *pdev)
> err_irq:
> free_irq(i2c->irq, i2c);
>
> - err_iomap:
> - iounmap(i2c->regs);
> -
> err_clk:
> clk_disable_unprepare(i2c->clk);
> return ret;
> @@ -1100,8 +1097,6 @@ static int s3c24xx_i2c_remove(struct platform_device *pdev)
>
> clk_disable_unprepare(i2c->clk);
>
> - iounmap(i2c->regs);
> -
> s3c24xx_i2c_dt_gpio_free(i2c);
>
> return 0;
> --
> 1.7.4.1
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/



--
With warm regards,
Sachin

2012-11-23 06:15:21

by Shubhrajyoti Datta

[permalink] [raw]
Subject: Re: [PATCH 0/7] i2c: s3c2410: Add devm_* apis and cleanup

On Fri, Nov 23, 2012 at 11:29 AM, Tushar Behera
<[email protected]> wrote:
> This patchset cleans up the probe function of i2c-s3c2410 driver.
> These have been tested on Exynos4210 based Origen board.
>
> Tushar Behera (7):
> i2c: s3c2410: Remove unnecessary label err_noclk
> i2c: s3c2410: Convert to use devm_clk_get()
> i2c: s3c2410: Convert to use devm_request_mem_region()
> i2c: s3c2410: Convert to use devm_ioremap()
> i2c: s3c2410: Convert to use devm_request_irq()

You may want to consider request_and_ioremap.


> i2c: s3c2410: Move location of clk_prepare_enable() call in probe
> function
> i2c: s3c2410: Remove err_cpufreq label
>
> drivers/i2c/busses/i2c-s3c2410.c | 74 ++++++++++++--------------------------
> 1 files changed, 23 insertions(+), 51 deletions(-)
>
> --
> 1.7.4.1
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html

2012-11-23 06:43:13

by Tushar Behera

[permalink] [raw]
Subject: Re: [PATCH 4/7] i2c: s3c2410: Convert to use devm_ioremap()

On 11/23/2012 11:44 AM, Sachin Kamat wrote:
> Hi Tushar,
>
> On 23 November 2012 11:29, Tushar Behera <[email protected]> wrote:
>> Signed-off-by: Tushar Behera <[email protected]>
>> ---
>> drivers/i2c/busses/i2c-s3c2410.c | 13 ++++---------
>> 1 files changed, 4 insertions(+), 9 deletions(-)
>>
>> diff --git a/drivers/i2c/busses/i2c-s3c2410.c b/drivers/i2c/busses/i2c-s3c2410.c
>> index a274ef7..3446af2 100644
>> --- a/drivers/i2c/busses/i2c-s3c2410.c
>> +++ b/drivers/i2c/busses/i2c-s3c2410.c
>> @@ -996,7 +996,7 @@ static int s3c24xx_i2c_probe(struct platform_device *pdev)
>> goto err_clk;
>> }
>>
>> - i2c->regs = ioremap(res->start, resource_size(res));
>> + i2c->regs = devm_ioremap(&pdev->dev, res->start, resource_size(res));
>>
>
> request_mem_region and ioremap and be replaced using a single
> devm_request_and_ioremap() call.
>

Thanks. I will redo the patch.

> Also you may squash patches 2-5 into single convert to devm_* functions patch.
>

Ok. In that case, I will squash these patches to a single patch.

>
>> if (i2c->regs == NULL) {
>> dev_err(&pdev->dev, "cannot map IO\n");
>> @@ -1016,7 +1016,7 @@ static int s3c24xx_i2c_probe(struct platform_device *pdev)
>>
>> ret = s3c24xx_i2c_init(i2c);
>> if (ret != 0)
>> - goto err_iomap;
>> + goto err_clk;
>>
>> /* find the IRQ for this unit (note, this relies on the init call to
>> * ensure no current IRQs pending
>> @@ -1025,7 +1025,7 @@ static int s3c24xx_i2c_probe(struct platform_device *pdev)
>> i2c->irq = ret = platform_get_irq(pdev, 0);
>> if (ret <= 0) {
>> dev_err(&pdev->dev, "cannot find IRQ\n");
>> - goto err_iomap;
>> + goto err_clk;
>> }
>>
>> ret = request_irq(i2c->irq, s3c24xx_i2c_irq, 0,
>> @@ -1033,7 +1033,7 @@ static int s3c24xx_i2c_probe(struct platform_device *pdev)
>>
>> if (ret != 0) {
>> dev_err(&pdev->dev, "cannot claim IRQ %d\n", i2c->irq);
>> - goto err_iomap;
>> + goto err_clk;
>> }
>>
>> ret = s3c24xx_i2c_register_cpufreq(i2c);
>> @@ -1073,9 +1073,6 @@ static int s3c24xx_i2c_probe(struct platform_device *pdev)
>> err_irq:
>> free_irq(i2c->irq, i2c);
>>
>> - err_iomap:
>> - iounmap(i2c->regs);
>> -
>> err_clk:
>> clk_disable_unprepare(i2c->clk);
>> return ret;
>> @@ -1100,8 +1097,6 @@ static int s3c24xx_i2c_remove(struct platform_device *pdev)
>>
>> clk_disable_unprepare(i2c->clk);
>>
>> - iounmap(i2c->regs);
>> -
>> s3c24xx_i2c_dt_gpio_free(i2c);
>>
>> return 0;
>> --
>> 1.7.4.1
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
>> the body of a message to [email protected]
>> More majordomo info at http://vger.kernel.org/majordomo-info.html
>> Please read the FAQ at http://www.tux.org/lkml/
>
>
>


--
Tushar Behera

2012-11-23 06:44:27

by Tushar Behera

[permalink] [raw]
Subject: Re: [PATCH 0/7] i2c: s3c2410: Add devm_* apis and cleanup

On 11/23/2012 11:45 AM, Shubhrajyoti Datta wrote:
> On Fri, Nov 23, 2012 at 11:29 AM, Tushar Behera
> <[email protected]> wrote:
>> This patchset cleans up the probe function of i2c-s3c2410 driver.
>> These have been tested on Exynos4210 based Origen board.
>>
>> Tushar Behera (7):
>> i2c: s3c2410: Remove unnecessary label err_noclk
>> i2c: s3c2410: Convert to use devm_clk_get()
>> i2c: s3c2410: Convert to use devm_request_mem_region()
>> i2c: s3c2410: Convert to use devm_ioremap()
>> i2c: s3c2410: Convert to use devm_request_irq()
>
> You may want to consider request_and_ioremap.
>

Thanks. I will redo the patchset and submit again.

>
>> i2c: s3c2410: Move location of clk_prepare_enable() call in probe
>> function
>> i2c: s3c2410: Remove err_cpufreq label
>>
>> drivers/i2c/busses/i2c-s3c2410.c | 74 ++++++++++++--------------------------
>> 1 files changed, 23 insertions(+), 51 deletions(-)
>>
>> --
>> 1.7.4.1
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
>> the body of a message to [email protected]
>> More majordomo info at http://vger.kernel.org/majordomo-info.html


--
Tushar Behera