diff options
author | Alexander Usyskin <alexander.usyskin@intel.com> | 2016-05-24 16:03:40 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-08-30 14:35:14 +0200 |
commit | 35eda92afa467232ab2a01422b813fa4a14542c5 (patch) | |
tree | 84a7f23758af250742d061c2d60ab336689f07c1 /drivers/misc/mei | |
parent | 22393381a489e61b87d85184c02cf070a410c80d (diff) | |
download | linux-35eda92afa467232ab2a01422b813fa4a14542c5.tar.bz2 |
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>
Diffstat (limited to 'drivers/misc/mei')
-rw-r--r-- | drivers/misc/mei/amthif.c | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/drivers/misc/mei/amthif.c b/drivers/misc/mei/amthif.c index 9885fa40a120..14b454143c81 100644 --- a/drivers/misc/mei/amthif.c +++ b/drivers/misc/mei/amthif.c @@ -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; } /** |