forked from Minki/linux
i2c: s3c2410: use clk_prepare_enable and clk_disable_unprepare
Convert clk_enable/clk_disable to clk_prepare_enable/clk_disable_unprepare calls as required by common clock framework. Signed-off-by: Thomas Abraham <thomas.abraham@linaro.org> Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
This commit is contained in:
parent
3db11feffc
commit
d3b64c5934
@ -601,14 +601,14 @@ static int s3c24xx_i2c_xfer(struct i2c_adapter *adap,
|
||||
int ret;
|
||||
|
||||
pm_runtime_get_sync(&adap->dev);
|
||||
clk_enable(i2c->clk);
|
||||
clk_prepare_enable(i2c->clk);
|
||||
|
||||
for (retry = 0; retry < adap->retries; retry++) {
|
||||
|
||||
ret = s3c24xx_i2c_doxfer(i2c, msgs, num);
|
||||
|
||||
if (ret != -EAGAIN) {
|
||||
clk_disable(i2c->clk);
|
||||
clk_disable_unprepare(i2c->clk);
|
||||
pm_runtime_put(&adap->dev);
|
||||
return ret;
|
||||
}
|
||||
@ -618,7 +618,7 @@ static int s3c24xx_i2c_xfer(struct i2c_adapter *adap,
|
||||
udelay(100);
|
||||
}
|
||||
|
||||
clk_disable(i2c->clk);
|
||||
clk_disable_unprepare(i2c->clk);
|
||||
pm_runtime_put(&adap->dev);
|
||||
return -EREMOTEIO;
|
||||
}
|
||||
@ -977,7 +977,7 @@ static int s3c24xx_i2c_probe(struct platform_device *pdev)
|
||||
|
||||
dev_dbg(&pdev->dev, "clock source %p\n", i2c->clk);
|
||||
|
||||
clk_enable(i2c->clk);
|
||||
clk_prepare_enable(i2c->clk);
|
||||
|
||||
/* map the registers */
|
||||
|
||||
@ -1065,7 +1065,7 @@ 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(i2c->clk);
|
||||
clk_disable_unprepare(i2c->clk);
|
||||
return 0;
|
||||
|
||||
err_cpufreq:
|
||||
@ -1082,7 +1082,7 @@ static int s3c24xx_i2c_probe(struct platform_device *pdev)
|
||||
kfree(i2c->ioarea);
|
||||
|
||||
err_clk:
|
||||
clk_disable(i2c->clk);
|
||||
clk_disable_unprepare(i2c->clk);
|
||||
clk_put(i2c->clk);
|
||||
|
||||
err_noclk:
|
||||
@ -1106,7 +1106,7 @@ static int s3c24xx_i2c_remove(struct platform_device *pdev)
|
||||
i2c_del_adapter(&i2c->adap);
|
||||
free_irq(i2c->irq, i2c);
|
||||
|
||||
clk_disable(i2c->clk);
|
||||
clk_disable_unprepare(i2c->clk);
|
||||
clk_put(i2c->clk);
|
||||
|
||||
iounmap(i2c->regs);
|
||||
@ -1135,9 +1135,9 @@ static int s3c24xx_i2c_resume(struct device *dev)
|
||||
struct s3c24xx_i2c *i2c = platform_get_drvdata(pdev);
|
||||
|
||||
i2c->suspended = 0;
|
||||
clk_enable(i2c->clk);
|
||||
clk_prepare_enable(i2c->clk);
|
||||
s3c24xx_i2c_init(i2c);
|
||||
clk_disable(i2c->clk);
|
||||
clk_disable_unprepare(i2c->clk);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user