Commit 252fa60e authored by Wolfram Sang's avatar Wolfram Sang Committed by Wolfram Sang

i2c: stu300: use xfer_atomic callback to bail out early

Use the new callback to reject atomic transfers.
Signed-off-by: default avatarWolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: default avatarLinus Walleij <linus.walleij@linaro.org>
Signed-off-by: default avatarWolfram Sang <wsa@the-dreams.de>
parent 3d11a12e
...@@ -328,12 +328,6 @@ static int stu300_start_and_await_event(struct stu300_dev *dev, ...@@ -328,12 +328,6 @@ static int stu300_start_and_await_event(struct stu300_dev *dev,
{ {
int ret; int ret;
if (unlikely(irqs_disabled())) {
/* TODO: implement polling for this case if need be. */
WARN(1, "irqs are disabled, cannot poll for event\n");
return -EIO;
}
/* Lock command issue, fill in an event we wait for */ /* Lock command issue, fill in an event we wait for */
spin_lock_irq(&dev->cmd_issue_lock); spin_lock_irq(&dev->cmd_issue_lock);
init_completion(&dev->cmd_complete); init_completion(&dev->cmd_complete);
...@@ -380,13 +374,6 @@ static int stu300_await_event(struct stu300_dev *dev, ...@@ -380,13 +374,6 @@ static int stu300_await_event(struct stu300_dev *dev,
{ {
int ret; int ret;
if (unlikely(irqs_disabled())) {
/* TODO: implement polling for this case if need be. */
dev_err(&dev->pdev->dev, "irqs are disabled on this "
"system!\n");
return -EIO;
}
/* Is it already here? */ /* Is it already here? */
spin_lock_irq(&dev->cmd_issue_lock); spin_lock_irq(&dev->cmd_issue_lock);
dev->cmd_err = STU300_ERROR_NONE; dev->cmd_err = STU300_ERROR_NONE;
...@@ -846,6 +833,13 @@ static int stu300_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs, ...@@ -846,6 +833,13 @@ static int stu300_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs,
return num; return num;
} }
static int stu300_xfer_todo(struct i2c_adapter *adap, struct i2c_msg *msgs, int num)
{
/* TODO: implement polling for this case if need be. */
WARN(1, "%s: atomic transfers not implemented\n", dev_name(&adap->dev));
return -EOPNOTSUPP;
}
static u32 stu300_func(struct i2c_adapter *adap) static u32 stu300_func(struct i2c_adapter *adap)
{ {
/* This is the simplest thing you can think of... */ /* This is the simplest thing you can think of... */
...@@ -854,6 +848,7 @@ static u32 stu300_func(struct i2c_adapter *adap) ...@@ -854,6 +848,7 @@ static u32 stu300_func(struct i2c_adapter *adap)
static const struct i2c_algorithm stu300_algo = { static const struct i2c_algorithm stu300_algo = {
.master_xfer = stu300_xfer, .master_xfer = stu300_xfer,
.master_xfer_atomic = stu300_xfer_todo,
.functionality = stu300_func, .functionality = stu300_func,
}; };
......
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