summaryrefslogtreecommitdiffstats
path: root/drivers/staging/greybus/operation.c
diff options
context:
space:
mode:
authorAlex Elder2014-11-18 20:26:53 +0100
committerGreg Kroah-Hartman2014-11-18 21:53:38 +0100
commit1f764af77c6adb3b4035b8f41b48198f251dc7f8 (patch)
tree4dec4add7512c57d4122a352eb257c60ab6f3877 /drivers/staging/greybus/operation.c
parentgreybus: stop storing hd in message (diff)
downloadkernel-qcow2-linux-1f764af77c6adb3b4035b8f41b48198f251dc7f8.tar.gz
kernel-qcow2-linux-1f764af77c6adb3b4035b8f41b48198f251dc7f8.tar.xz
kernel-qcow2-linux-1f764af77c6adb3b4035b8f41b48198f251dc7f8.zip
greybus: stop storing dest_cport_id in message
We can derive the destination CPort id of any (outbound) message from the connection it's operation is associated with. So we don't need to store that information in every message. As a result, we no longer need to record it at message initialization time. Signed-off-by: Alex Elder <elder@linaro.org> Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
Diffstat (limited to 'drivers/staging/greybus/operation.c')
-rw-r--r--drivers/staging/greybus/operation.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/drivers/staging/greybus/operation.c b/drivers/staging/greybus/operation.c
index 23cf745a337a..705b195dfe01 100644
--- a/drivers/staging/greybus/operation.c
+++ b/drivers/staging/greybus/operation.c
@@ -106,10 +106,11 @@ gb_pending_operation_find(struct gb_connection *connection, u16 id)
static int gb_message_send(struct gb_message *message, gfp_t gfp_mask)
{
struct gb_connection *connection = message->operation->connection;
+ u16 dest_cport_id = connection->interface_cport_id;
message->status = -EINPROGRESS;
message->cookie = connection->hd->driver->buffer_send(connection->hd,
- message->dest_cport_id,
+ dest_cport_id,
message->buffer,
message->buffer_size,
gfp_mask);
@@ -236,7 +237,6 @@ static int gb_operation_message_init(struct gb_operation *operation,
struct gb_message *message;
struct gb_operation_msg_hdr *header;
gfp_t gfp_flags = request && !outbound ? GFP_ATOMIC : GFP_KERNEL;
- u16 dest_cport_id;
if (size > GB_OPERATION_MESSAGE_SIZE_MAX)
return -E2BIG;
@@ -249,16 +249,10 @@ static int gb_operation_message_init(struct gb_operation *operation,
type |= GB_OPERATION_TYPE_RESPONSE;
}
- if (outbound)
- dest_cport_id = connection->interface_cport_id;
- else
- dest_cport_id = CPORT_ID_BAD;
-
message->buffer = hd->driver->buffer_alloc(size, gfp_flags);
if (!message->buffer)
return -ENOMEM;
message->buffer_size = size;
- message->dest_cport_id = dest_cport_id;
message->status = -EBADR; /* Initial value--means "never set" */
/* Fill in the header structure */