i2c: s3c2410: 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: Wolfram Sang <wsa+renesas@sang-engineering.com> Tested-by: Marek Szyprowski <m.szyprowski@samsung.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
This commit is contained in:
parent
d5c95bd6f3
commit
2088716f90
@ -104,7 +104,6 @@ enum s3c24xx_i2c_state {
|
|||||||
struct s3c24xx_i2c {
|
struct s3c24xx_i2c {
|
||||||
wait_queue_head_t wait;
|
wait_queue_head_t wait;
|
||||||
kernel_ulong_t quirks;
|
kernel_ulong_t quirks;
|
||||||
unsigned int suspended:1;
|
|
||||||
|
|
||||||
struct i2c_msg *msg;
|
struct i2c_msg *msg;
|
||||||
unsigned int msg_num;
|
unsigned int msg_num;
|
||||||
@ -703,9 +702,6 @@ static int s3c24xx_i2c_doxfer(struct s3c24xx_i2c *i2c,
|
|||||||
unsigned long timeout;
|
unsigned long timeout;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
if (i2c->suspended)
|
|
||||||
return -EIO;
|
|
||||||
|
|
||||||
ret = s3c24xx_i2c_set_master(i2c);
|
ret = s3c24xx_i2c_set_master(i2c);
|
||||||
if (ret != 0) {
|
if (ret != 0) {
|
||||||
dev_err(i2c->dev, "cannot get bus (error %d)\n", ret);
|
dev_err(i2c->dev, "cannot get bus (error %d)\n", ret);
|
||||||
@ -1246,7 +1242,7 @@ static int s3c24xx_i2c_suspend_noirq(struct device *dev)
|
|||||||
{
|
{
|
||||||
struct s3c24xx_i2c *i2c = dev_get_drvdata(dev);
|
struct s3c24xx_i2c *i2c = dev_get_drvdata(dev);
|
||||||
|
|
||||||
i2c->suspended = 1;
|
i2c_mark_adapter_suspended(&i2c->adap);
|
||||||
|
|
||||||
if (!IS_ERR(i2c->sysreg))
|
if (!IS_ERR(i2c->sysreg))
|
||||||
regmap_read(i2c->sysreg, EXYNOS5_SYS_I2C_CFG, &i2c->sys_i2c_cfg);
|
regmap_read(i2c->sysreg, EXYNOS5_SYS_I2C_CFG, &i2c->sys_i2c_cfg);
|
||||||
@ -1267,7 +1263,7 @@ static int s3c24xx_i2c_resume_noirq(struct device *dev)
|
|||||||
return ret;
|
return ret;
|
||||||
s3c24xx_i2c_init(i2c);
|
s3c24xx_i2c_init(i2c);
|
||||||
clk_disable(i2c->clk);
|
clk_disable(i2c->clk);
|
||||||
i2c->suspended = 0;
|
i2c_mark_adapter_resumed(&i2c->adap);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user