Commit d5c95bd6 authored by Wolfram Sang's avatar Wolfram Sang Committed by Wolfram Sang

i2c: exynos5: use core helper to mark adapter suspended

Rejecting transfers should be handled by the core. Also, this will
ensure proper locking which was forgotten in this open coded version.
Signed-off-by: default avatarWolfram Sang <wsa+renesas@sang-engineering.com>
Tested-by: default avatarMarek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: default avatarWolfram Sang <wsa@the-dreams.de>
parent 5a7b81ff
...@@ -183,7 +183,6 @@ enum i2c_type_exynos { ...@@ -183,7 +183,6 @@ enum i2c_type_exynos {
struct exynos5_i2c { struct exynos5_i2c {
struct i2c_adapter adap; struct i2c_adapter adap;
unsigned int suspended:1;
struct i2c_msg *msg; struct i2c_msg *msg;
struct completion msg_complete; struct completion msg_complete;
...@@ -715,11 +714,6 @@ static int exynos5_i2c_xfer(struct i2c_adapter *adap, ...@@ -715,11 +714,6 @@ static int exynos5_i2c_xfer(struct i2c_adapter *adap,
struct exynos5_i2c *i2c = adap->algo_data; struct exynos5_i2c *i2c = adap->algo_data;
int i, ret; int i, ret;
if (i2c->suspended) {
dev_err(i2c->dev, "HS-I2C is not initialized.\n");
return -EIO;
}
ret = clk_enable(i2c->clk); ret = clk_enable(i2c->clk);
if (ret) if (ret)
return ret; return ret;
...@@ -847,8 +841,7 @@ static int exynos5_i2c_suspend_noirq(struct device *dev) ...@@ -847,8 +841,7 @@ static int exynos5_i2c_suspend_noirq(struct device *dev)
{ {
struct exynos5_i2c *i2c = dev_get_drvdata(dev); struct exynos5_i2c *i2c = dev_get_drvdata(dev);
i2c->suspended = 1; i2c_mark_adapter_suspended(&i2c->adap);
clk_unprepare(i2c->clk); clk_unprepare(i2c->clk);
return 0; return 0;
...@@ -871,7 +864,7 @@ static int exynos5_i2c_resume_noirq(struct device *dev) ...@@ -871,7 +864,7 @@ static int exynos5_i2c_resume_noirq(struct device *dev)
exynos5_i2c_init(i2c); exynos5_i2c_init(i2c);
clk_disable(i2c->clk); clk_disable(i2c->clk);
i2c->suspended = 0; i2c_mark_adapter_resumed(&i2c->adap);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment