summaryrefslogtreecommitdiff
path: root/drivers/misc/mei/amthif.c
diff options
context:
space:
mode:
authorTomas Winkler <tomas.winkler@intel.com>2015-02-10 08:39:43 (GMT)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-03-02 03:37:00 (GMT)
commitbca67d681c4864b74fa5fae9ee47e562d1e272b1 (patch)
tree1538db82496b44cc2f7343714ed4a949311f1815 /drivers/misc/mei/amthif.c
parent5db7514d9333c920791538c850cfb9dbd19025f7 (diff)
downloadlinux-bca67d681c4864b74fa5fae9ee47e562d1e272b1.tar.xz
mei: always initialize the callback with the intended operation type
We set the operation type at initialization time as each cb is used only for a single type of operation As a byproduct we add a convenient wrapper for allocating cb with the data buffer. Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/misc/mei/amthif.c')
-rw-r--r--drivers/misc/mei/amthif.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/misc/mei/amthif.c b/drivers/misc/mei/amthif.c
index 2cc41cb..3fdd223 100644
--- a/drivers/misc/mei/amthif.c
+++ b/drivers/misc/mei/amthif.c
@@ -254,7 +254,7 @@ static int mei_amthif_read_start(struct mei_cl *cl, struct file *file)
size_t length = dev->iamthif_mtu;
int rets;
- cb = mei_io_cb_init(cl, file);
+ cb = mei_io_cb_init(cl, MEI_FOP_READ, file);
if (!cb) {
rets = -ENOMEM;
goto err;
@@ -264,7 +264,6 @@ static int mei_amthif_read_start(struct mei_cl *cl, struct file *file)
if (rets)
goto err;
- cb->fop_type = MEI_FOP_READ;
list_add_tail(&cb->list, &dev->ctrl_wr_list.list);
dev->iamthif_state = MEI_IAMTHIF_READING;
@@ -359,7 +358,6 @@ int mei_amthif_write(struct mei_cl *cl, struct mei_cl_cb *cb)
dev = cl->dev;
- cb->fop_type = MEI_FOP_WRITE;
list_add_tail(&cb->list, &dev->amthif_cmd_list.list);
return mei_amthif_run_next_cmd(dev);
}