* hardware designers for this issue...
*/
struct gbuf *greybus_alloc_gbuf(struct gb_operation *operation,
- gbuf_complete_t complete,
unsigned int size,
bool outbound,
gfp_t gfp_mask)
kref_init(&gbuf->kref);
gbuf->operation = operation;
gbuf->outbound = outbound;
- gbuf->complete = complete;
gbuf->status = -EBADR; /* Initial value--means "never set" */
/* Host controller specific allocation for the actual buffer */
*/
-
-struct gbuf;
-
-typedef void (*gbuf_complete_t)(struct gbuf *gbuf);
-
struct gbuf {
struct kref kref;
bool outbound; /* AP-relative data direction */
void *hcd_data; /* for the HCD to track the gbuf */
- gbuf_complete_t complete;
};
u8 *data, size_t length);
struct gbuf *greybus_alloc_gbuf(struct gb_operation *operation,
- gbuf_complete_t complete, unsigned int size,
- bool outbound, gfp_t gfp_mask);
+ unsigned int size, 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
gbuf = operation->request;
else
gbuf = operation->response;
- gbuf->complete(gbuf);
+ gb_operation_gbuf_complete(gbuf);
}
/*
gfp_t gfp_flags = data_out ? GFP_KERNEL : GFP_ATOMIC;
size += sizeof(*header);
- gbuf = greybus_alloc_gbuf(operation, gb_operation_gbuf_complete,
- size, data_out, gfp_flags);
+ gbuf = greybus_alloc_gbuf(operation, size, data_out, gfp_flags);
if (!gbuf)
return NULL;