greybus: es2: fix arpc response lookups

Fix arpc response lookups that were truncating the 16-bit response id to
8-bit, something which would have lead to all arpc calls timing out
after the 256th request.

Testing done: Enumerated and ejected a module on EVT2.

Signed-off-by: Johan Hovold <johan@hovoldconsulting.com>
Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Alex Elder <elder@linaro.org>
This commit is contained in:
Johan Hovold 2016-07-14 12:55:00 -05:00 коммит произвёл Alex Elder
Родитель e818027c0b
Коммит 165a74ab14
1 изменённых файлов: 3 добавлений и 3 удалений

Просмотреть файл

@ -1122,12 +1122,12 @@ static void arpc_free(struct arpc *rpc)
kfree(rpc);
}
static struct arpc *arpc_find(struct es2_ap_dev *es2, u8 id)
static struct arpc *arpc_find(struct es2_ap_dev *es2, __le16 id)
{
struct arpc *rpc;
list_for_each_entry(rpc, &es2->arpcs, list) {
if (le16_to_cpu(rpc->req->id) == id)
if (rpc->req->id == id)
return rpc;
}
@ -1250,7 +1250,7 @@ static void arpc_in_callback(struct urb *urb)
resp = urb->transfer_buffer;
spin_lock_irqsave(&es2->arpc_lock, flags);
rpc = arpc_find(es2, le16_to_cpu(resp->id));
rpc = arpc_find(es2, resp->id);
if (!rpc) {
dev_err(dev, "invalid arpc response id received: %d\n",
resp->id);