From: Alex Elder Date: Mon, 6 Oct 2014 11:53:09 +0000 (-0500) Subject: greybus: look up connection for recevied messages X-Git-Tag: v4.9-rc1~119^2~378^2~21^2~2034 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=00d2e7588c79a2b9681f243d06ad02a254ab4ff9;p=karo-tx-linux.git greybus: look up connection for recevied messages Look up the connection that an incoming message is associated with. This is the start of making message handling oriented toward the the connection rather than the cport. Signed-off-by: Alex Elder Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/greybus/gbuf.c b/drivers/staging/greybus/gbuf.c index fada12192726..17c1af8a00e8 100644 --- a/drivers/staging/greybus/gbuf.c +++ b/drivers/staging/greybus/gbuf.c @@ -179,6 +179,14 @@ void greybus_cport_in(struct greybus_host_device *hd, u16 cport_id, { struct gb_cport_handler *ch; struct gbuf *gbuf; + struct gb_connection *connection; + + connection = gb_hd_connection_find(hd, cport_id); + if (!connection) { + dev_err(hd->parent, + "nonexistent connection (%zu bytes dropped)\n", length); + return; + } /* first check to see if we have a cport handler for this cport */ ch = &cport_handler[cport_id];