greybus: es2: fix arpc response lookups
authorJohan Hovold <johan@hovoldconsulting.com>
Thu, 14 Jul 2016 17:55:00 +0000 (12:55 -0500)
committerAlex Elder <elder@linaro.org>
Thu, 14 Jul 2016 19:36:33 +0000 (14:36 -0500)
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>
drivers/staging/greybus/es2.c

index 7c294c4..7961622 100644 (file)
@@ -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);