mei: wd: simplify wd_send command

Add reduce credits to wd_send to remove code
repetition and simplify error handling

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Alexander Usyskin <alexander.usyskin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Tomas Winkler
2014-02-19 17:35:50 +02:00
committed by Greg Kroah-Hartman
parent 7ca96aa278
commit b6d81fd661
2 changed files with 30 additions and 29 deletions

View File

@@ -480,10 +480,9 @@ int mei_irq_write_handler(struct mei_device *dev, struct mei_cl_cb *cmpl_list)
if (mei_cl_is_connected(&dev->wd_cl)) {
if (dev->wd_pending &&
mei_cl_flow_ctrl_creds(&dev->wd_cl) > 0) {
if (mei_wd_send(dev))
dev_dbg(&dev->pdev->dev, "wd send failed.\n");
else if (mei_cl_flow_ctrl_reduce(&dev->wd_cl))
return -EIO;
ret = mei_wd_send(dev);
if (ret)
return ret;
dev->wd_pending = false;
}
}