summaryrefslogtreecommitdiffstats
path: root/drivers/staging/greybus/greybus.h
diff options
context:
space:
mode:
authorAlex Elder2015-06-13 18:02:07 +0200
committerGreg Kroah-Hartman2015-06-16 01:49:00 +0200
commit821c620afa1ad29be6a85a9a3f691e32e973a317 (patch)
treedad00170634d0fbbe036951e2451782c6418ef5e /drivers/staging/greybus/greybus.h
parentgreybus: manifest: clean up properly when parsing bundles (diff)
downloadkernel-qcow2-linux-821c620afa1ad29be6a85a9a3f691e32e973a317.tar.gz
kernel-qcow2-linux-821c620afa1ad29be6a85a9a3f691e32e973a317.tar.xz
kernel-qcow2-linux-821c620afa1ad29be6a85a9a3f691e32e973a317.zip
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.h5
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 */