summaryrefslogtreecommitdiffstats
path: root/drivers/staging/greybus/kernel_ver.h
diff options
context:
space:
mode:
authorAlex Elder <elder@linaro.org>2014-09-30 19:25:21 -0500
committerGreg Kroah-Hartman <greg@kroah.com>2014-09-30 18:19:12 -0700
commit1cfc667d75d3a38989365da387f52a1c303c435d (patch)
tree43c8a7c25a91d0dd807ca7f2ac91acf3f5f1224b /drivers/staging/greybus/kernel_ver.h
parentf0f70916fba72ca70235ca40db43030ec8f467ad (diff)
downloadop-kernel-dev-1cfc667d75d3a38989365da387f52a1c303c435d.zip
op-kernel-dev-1cfc667d75d3a38989365da387f52a1c303c435d.tar.gz
greybus: kill struct gmod_cport
A UniPro (short header) segment has a 5-bit field to represent a CPort Id. In addition, the 7-bit L3 short header holds a UniPro device id. There can be no more than 128 devices in a UniPro network, but these two fields can be combined in ways to allow for over 2000 CPorts within a single device. As a result, a device id is represented with one byte, and a CPort Id within a device is always representable with a two byte value. This patch changes integral values that reresent CPort Ids so they use type u16 consistently. Separately, the contents of the gmod_cport structure were mostly fabricated, with the cport_id field being the only one that's meaningful. This patch gets rid of that structure, putting a simple u16 to represent the CPort Id everywhere it had been used before. Signed-off-by: Alex Elder <elder@linaro.org> Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
Diffstat (limited to 'drivers/staging/greybus/kernel_ver.h')
-rw-r--r--drivers/staging/greybus/kernel_ver.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/staging/greybus/kernel_ver.h b/drivers/staging/greybus/kernel_ver.h
index 40cc2e8..4aa5b83 100644
--- a/drivers/staging/greybus/kernel_ver.h
+++ b/drivers/staging/greybus/kernel_ver.h
@@ -18,5 +18,8 @@
struct device_attribute dev_attr_##_name = __ATTR_RO(_name)
#endif
+#ifndef U8_MAX
+#define U8_MAX ((u8)~0U)
+#endif /* ! U8_MAX */
#endif /* __GREYBUS_KERNEL_VER_H */
OpenPOWER on IntegriCloud