summaryrefslogtreecommitdiffstats
path: root/drivers/misc/mei/main.c
diff options
context:
space:
mode:
authorTomas Winkler <tomas.winkler@intel.com>2015-02-10 10:39:43 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-03-01 19:37:00 -0800
commitbca67d681c4864b74fa5fae9ee47e562d1e272b1 (patch)
tree1538db82496b44cc2f7343714ed4a949311f1815 /drivers/misc/mei/main.c
parent5db7514d9333c920791538c850cfb9dbd19025f7 (diff)
downloadop-kernel-dev-bca67d681c4864b74fa5fae9ee47e562d1e272b1.zip
op-kernel-dev-bca67d681c4864b74fa5fae9ee47e562d1e272b1.tar.gz
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/main.c')
-rw-r--r--drivers/misc/mei/main.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/misc/mei/main.c b/drivers/misc/mei/main.c
index 1d44d11..369de0a 100644
--- a/drivers/misc/mei/main.c
+++ b/drivers/misc/mei/main.c
@@ -209,7 +209,7 @@ static ssize_t mei_read(struct file *file, char __user *ubuf,
*offset = 0;
}
- err = mei_cl_read_start(cl, length);
+ err = mei_cl_read_start(cl, length, file);
if (err && err != -EBUSY) {
dev_dbg(dev->dev,
"mei start read failure with status = %d\n", err);
@@ -383,15 +383,11 @@ static ssize_t mei_write(struct file *file, const char __user *ubuf,
} else if (cl->reading_state == MEI_IDLE)
*offset = 0;
-
- write_cb = mei_io_cb_init(cl, file);
+ write_cb = mei_cl_alloc_cb(cl, length, MEI_FOP_WRITE, file);
if (!write_cb) {
rets = -ENOMEM;
goto out;
}
- rets = mei_io_cb_alloc_buf(write_cb, length);
- if (rets)
- goto out;
rets = copy_from_user(write_cb->buf.data, ubuf, length);
if (rets) {
OpenPOWER on IntegriCloud