diff options
author | Alex Elder <elder@linaro.org> | 2015-06-13 11:02:07 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@google.com> | 2015-06-15 16:49:00 -0700 |
commit | 821c620afa1ad29be6a85a9a3f691e32e973a317 (patch) | |
tree | dad00170634d0fbbe036951e2451782c6418ef5e /drivers/staging/greybus/greybus.h | |
parent | 2a64fb0e1e13eee53e56805d8a1f0ff7bbf57306 (diff) | |
download | linux-821c620afa1ad29be6a85a9a3f691e32e973a317.tar.bz2 |
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>
Diffstat (limited to 'drivers/staging/greybus/greybus.h')
-rw-r--r-- | drivers/staging/greybus/greybus.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/staging/greybus/greybus.h b/drivers/staging/greybus/greybus.h index 05eab4c5f9a0..518f142b6b5f 100644 --- a/drivers/staging/greybus/greybus.h +++ b/drivers/staging/greybus/greybus.h @@ -196,5 +196,10 @@ static inline int is_gb_connection(const struct device *dev) return dev->type == &greybus_connection_type; } +static inline bool cport_id_valid(u16 cport_id) +{ + return cport_id != CPORT_ID_BAD; +} + #endif /* __KERNEL__ */ #endif /* __LINUX_GREYBUS_H */ |