summaryrefslogtreecommitdiffstats
path: root/drivers/misc/mei/interrupt.c
diff options
context:
space:
mode:
authorTomas Winkler <tomas.winkler@intel.com>2015-02-10 09:39:42 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-03-02 04:37:00 +0100
commit5db7514d9333c920791538c850cfb9dbd19025f7 (patch)
tree7dea99b1500378cf33b3fb1bab7e1297c150f810 /drivers/misc/mei/interrupt.c
parentmei: iamthif: use regular client read functions (diff)
downloadlinux-5db7514d9333c920791538c850cfb9dbd19025f7.tar.xz
linux-5db7514d9333c920791538c850cfb9dbd19025f7.zip
mei: use only one buffer in callback
The callback structure is used exclusively for reading or writing therefore there is no reason to hold both response and request buffers in the callback structure Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/misc/mei/interrupt.c')
-rw-r--r--drivers/misc/mei/interrupt.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/drivers/misc/mei/interrupt.c b/drivers/misc/mei/interrupt.c
index 466c1d22fb16..60469a0053bb 100644
--- a/drivers/misc/mei/interrupt.c
+++ b/drivers/misc/mei/interrupt.c
@@ -134,19 +134,17 @@ int mei_cl_irq_read_msg(struct mei_cl *cl,
cl->reading_state = MEI_READING;
- if (cb->response_buffer.size == 0 ||
- cb->response_buffer.data == NULL) {
+ if (cb->buf.size == 0 || cb->buf.data == NULL) {
cl_err(dev, cl, "response buffer is not allocated.\n");
list_move_tail(&cb->list, &complete_list->list);
cb->status = -ENOMEM;
goto out;
}
- if (cb->response_buffer.size < mei_hdr->length + cb->buf_idx) {
+ if (cb->buf.size < mei_hdr->length + cb->buf_idx) {
cl_dbg(dev, cl, "message overflow. size %d len %d idx %ld\n",
- cb->response_buffer.size, mei_hdr->length, cb->buf_idx);
- buffer = krealloc(cb->response_buffer.data,
- mei_hdr->length + cb->buf_idx,
+ cb->buf.size, mei_hdr->length, cb->buf_idx);
+ buffer = krealloc(cb->buf.data, mei_hdr->length + cb->buf_idx,
GFP_KERNEL);
if (!buffer) {
@@ -154,11 +152,11 @@ int mei_cl_irq_read_msg(struct mei_cl *cl,
list_move_tail(&cb->list, &complete_list->list);
goto out;
}
- cb->response_buffer.data = buffer;
- cb->response_buffer.size = mei_hdr->length + cb->buf_idx;
+ cb->buf.data = buffer;
+ cb->buf.size = mei_hdr->length + cb->buf_idx;
}
- buffer = cb->response_buffer.data + cb->buf_idx;
+ buffer = cb->buf.data + cb->buf_idx;
mei_read_slots(dev, buffer, mei_hdr->length);
cb->buf_idx += mei_hdr->length;