greybus: introduce cport_id_valid()
authorAlex Elder <elder@linaro.org>
Sat, 13 Jun 2015 16:02:07 +0000 (11:02 -0500)
committerGreg Kroah-Hartman <gregkh@google.com>
Mon, 15 Jun 2015 23:49:00 +0000 (16:49 -0700)
commit821c620afa1ad29be6a85a9a3f691e32e973a317
treedad00170634d0fbbe036951e2451782c6418ef5e
parent2a64fb0e1e13eee53e56805d8a1f0ff7bbf57306
greybus: introduce cport_id_valid()

Define a public predicate that defines whether a CPort ID is valid.

Use it in the message_send() routine, and make the message reported
more accurately reflect the error.  Also use it to check whether the
CPort ID in a received message is valid; if it is not, just drop the
message.

Get rid of local variable "buffer" in message_send(); it adds no
value.

Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
drivers/staging/greybus/es1.c
drivers/staging/greybus/es2.c
drivers/staging/greybus/greybus.h