2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-21 03:33:59 +08:00

mei: amthif: use mei_cl_alloc_cb for allocating cbs

Use mei_cl_alloc_cb wrapper instead of open code steps

Signed-off-by: Alexander Usyskin <alexander.usyskin@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Alexander Usyskin 2016-05-24 16:03:40 -04:00 committed by Greg Kroah-Hartman
parent 22393381a4
commit 35eda92afa

View File

@ -196,17 +196,10 @@ static int mei_amthif_read_start(struct mei_cl *cl, const struct file *file)
{
struct mei_device *dev = cl->dev;
struct mei_cl_cb *cb;
int rets;
cb = mei_io_cb_init(cl, MEI_FOP_READ, file);
if (!cb) {
rets = -ENOMEM;
goto err;
}
rets = mei_io_cb_alloc_buf(cb, mei_cl_mtu(cl));
if (rets)
goto err;
cb = mei_cl_alloc_cb(cl, mei_cl_mtu(cl), MEI_FOP_READ, file);
if (!cb)
return -ENOMEM;
list_add_tail(&cb->list, &dev->ctrl_wr_list.list);
@ -214,9 +207,6 @@ static int mei_amthif_read_start(struct mei_cl *cl, const struct file *file)
dev->iamthif_fp = cb->fp;
return 0;
err:
mei_io_cb_free(cb);
return rets;
}
/**