summaryrefslogtreecommitdiff
path: root/drivers/staging/greybus/operation.c
diff options
context:
space:
mode:
authorJohan Hovold <johan@hovoldconsulting.com>2015-04-07 11:27:21 +0200
committerGreg Kroah-Hartman <gregkh@google.com>2015-04-07 17:31:05 +0200
commit24ef4853986e740b90c4647b8ede70ed690185e2 (patch)
tree70b572f2aaca527addea13753f324f137dc41fa4 /drivers/staging/greybus/operation.c
parent491e60d63fde0a9ff09490a070d7bc22ff82c9ce (diff)
greybus: drop host-driver buffer headroom
Drop the host-driver buffer headroom that was used to transfer the cport id on ES1 and ES2. Rather than transferring additional bytes on the wire and having to deal with buffer-alignment issues (e.g. requiring the headroom to be a multiple of 8 bytes) simply drop the headroom functionality. Host drivers are expected set up their transfer descriptors separately from the data buffers and any intermediate drivers (e.g. for Greybus over USB) can (ab)use the operation message pad bytes for now. Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Reviewed-by: Alex Elder <elder@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Diffstat (limited to 'drivers/staging/greybus/operation.c')
-rw-r--r--drivers/staging/greybus/operation.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/staging/greybus/operation.c b/drivers/staging/greybus/operation.c
index 4d9e321b9e1d..3639e27e288a 100644
--- a/drivers/staging/greybus/operation.c
+++ b/drivers/staging/greybus/operation.c
@@ -230,7 +230,7 @@ static void gb_operation_message_init(struct greybus_host_device *hd,
u8 *buffer;
buffer = message->buffer;
- header = (struct gb_operation_msg_hdr *)(buffer + hd->buffer_headroom);
+ header = message->buffer;
message->header = header;
message->payload = payload_size ? header + 1 : NULL;
@@ -271,7 +271,6 @@ static void gb_operation_message_init(struct greybus_host_device *hd,
* they'll be filled in by arriving data.
*
* Our message buffers have the following layout:
- * headroom
* message header \_ these combined are
* message payload / the message size
*/
@@ -282,7 +281,6 @@ gb_operation_message_alloc(struct greybus_host_device *hd, u8 type,
struct gb_message *message;
struct gb_operation_msg_hdr *header;
size_t message_size = payload_size + sizeof(*header);
- size_t size;
if (hd->buffer_size_max > GB_OPERATION_MESSAGE_SIZE_MAX) {
pr_warn("limiting buffer size to %u\n",
@@ -301,8 +299,7 @@ gb_operation_message_alloc(struct greybus_host_device *hd, u8 type,
if (!message)
return NULL;
- size = hd->buffer_headroom + message_size;
- message->buffer = kzalloc(size, gfp_flags);
+ message->buffer = kzalloc(message_size, gfp_flags);
if (!message->buffer)
goto err_free_message;