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: Alex Elder <elder@linaro.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
This commit is contained in:
Alex Elder 2014-11-06 07:01:03 -06:00 committed by Greg Kroah-Hartman
parent ef45fa33a4
commit a77b06809b
3 changed files with 4 additions and 8 deletions

View file

@ -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 */

View file

@ -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

View file

@ -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;