* @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
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;
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 */
bool outbound; /* AP-relative data direction */
- void *context;
void *hcd_data; /* for the HCD to track the gbuf */
gbuf_complete_t complete;
};
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
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;
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;