diff options
Diffstat (limited to 'drivers/misc/mei/main.c')
-rw-r--r-- | drivers/misc/mei/main.c | 25 |
1 files changed, 5 insertions, 20 deletions
diff --git a/drivers/misc/mei/main.c b/drivers/misc/mei/main.c index d8221a5a7ee8..ff50cc14cc39 100644 --- a/drivers/misc/mei/main.c +++ b/drivers/misc/mei/main.c | |||
@@ -620,27 +620,12 @@ static ssize_t mei_write(struct file *file, const char __user *ubuf, | |||
620 | cl->sm_state |= MEI_WD_STATE_INDEPENDENCE_MSG_SENT; | 620 | cl->sm_state |= MEI_WD_STATE_INDEPENDENCE_MSG_SENT; |
621 | 621 | ||
622 | if (cl == &dev->iamthif_cl) { | 622 | if (cl == &dev->iamthif_cl) { |
623 | rets = mei_io_cb_alloc_resp_buf(write_cb, dev->iamthif_mtu); | 623 | rets = mei_amthif_write(dev, write_cb); |
624 | if (rets) | ||
625 | goto err; | ||
626 | 624 | ||
627 | write_cb->major_file_operations = MEI_IOCTL; | 625 | if (rets) { |
628 | 626 | dev_err(&dev->pdev->dev, | |
629 | if (!list_empty(&dev->amthi_cmd_list.list) || | 627 | "amthi write failed with status = %d\n", rets); |
630 | dev->iamthif_state != MEI_IAMTHIF_IDLE) { | 628 | goto err; |
631 | dev_dbg(&dev->pdev->dev, "amthi_state = %d\n", | ||
632 | (int) dev->iamthif_state); | ||
633 | dev_dbg(&dev->pdev->dev, "add amthi cb to amthi cmd waiting list\n"); | ||
634 | list_add_tail(&write_cb->list, &dev->amthi_cmd_list.list); | ||
635 | } else { | ||
636 | dev_dbg(&dev->pdev->dev, "call amthi write\n"); | ||
637 | rets = mei_amthif_write(dev, write_cb); | ||
638 | |||
639 | if (rets) { | ||
640 | dev_err(&dev->pdev->dev, "amthi write failed with status = %d\n", | ||
641 | rets); | ||
642 | goto err; | ||
643 | } | ||
644 | } | 629 | } |
645 | mutex_unlock(&dev->device_lock); | 630 | mutex_unlock(&dev->device_lock); |
646 | return length; | 631 | return length; |