Commit a77b0680 authored by Alex Elder's avatar Alex Elder Committed by Greg Kroah-Hartman

greybus: remove gbuf->context

A gbuf now records a pointer to its operation.   The only thing ever
stored in a gbuf context pointer is the gbuf's operation.  Therefore
there's no longer any need to maintain the context pointer, so get
rid of it.
Signed-off-by: default avatarAlex Elder <elder@linaro.org>
Signed-off-by: default avatarGreg Kroah-Hartman <greg@kroah.com>
parent ef45fa33
......@@ -28,7 +28,6 @@ static struct kmem_cache *gbuf_head_cache;
* @complete: callback when the gbuf is finished with
* @size: size of the buffer
* @gfp_mask: allocation mask
* @context: context added to the gbuf by the driver
*
* TODO: someday it will be nice to handle DMA, but for now, due to the
* architecture we are stuck with, the greybus core has to allocate the buffer
......@@ -39,8 +38,7 @@ struct gbuf *greybus_alloc_gbuf(struct gb_operation *operation,
gbuf_complete_t complete,
unsigned int size,
bool outbound,
gfp_t gfp_mask,
void *context)
gfp_t gfp_mask)
{
struct greybus_host_device *hd = operation->connection->hd;
struct gbuf *gbuf;
......@@ -54,7 +52,6 @@ struct gbuf *greybus_alloc_gbuf(struct gb_operation *operation,
gbuf->operation = operation;
gbuf->outbound = outbound;
gbuf->complete = complete;
gbuf->context = context;
gbuf->status = -EBADR; /* Initial value--means "never set" */
/* Host controller specific allocation for the actual buffer */
......
......@@ -133,7 +133,6 @@ struct gbuf {
bool outbound; /* AP-relative data direction */
void *context;
void *hcd_data; /* for the HCD to track the gbuf */
gbuf_complete_t complete;
};
......@@ -196,7 +195,7 @@ void greybus_gbuf_finished(struct gbuf *gbuf);
struct gbuf *greybus_alloc_gbuf(struct gb_operation *operation,
gbuf_complete_t complete, unsigned int size,
bool outbound, gfp_t gfp_mask, void *context);
bool outbound, gfp_t gfp_mask);
void greybus_free_gbuf(struct gbuf *gbuf);
struct gbuf *greybus_get_gbuf(struct gbuf *gbuf);
#define greybus_put_gbuf greybus_free_gbuf
......
......@@ -256,7 +256,7 @@ static void operation_timeout(struct work_struct *work)
static void gb_operation_gbuf_complete(struct gbuf *gbuf)
{
if (gbuf->status) {
struct gb_operation *operation = gbuf->context;
struct gb_operation *operation = gbuf->operation;
struct gb_operation_msg_hdr *header;
int id;
int type;
......@@ -301,7 +301,7 @@ static struct gbuf *gb_operation_gbuf_create(struct gb_operation *operation,
size += sizeof(*header);
gbuf = greybus_alloc_gbuf(operation, gb_operation_gbuf_complete,
size, data_out, gfp_flags, operation);
size, data_out, gfp_flags);
if (!gbuf)
return NULL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment