greybus: kill gbuf->complete
The gbuf complete method is a callback that allows the creator of a gbuf to know when all processing on a gbuf is done. We now only ever allocate gbufs for use in Greybus operations, and in that case we only ever supply gb_operation_gbuf_complete() as the completion callback. Furthermore, the only place gbuf->complete() is called is in gb_operation_recv_work(). Knowing this, we can just call gb_operation_gbuf_complete() directly from gb_operation_recv_work(), and get rid of the gbuf->complete() method entirely. Signed-off-by: Alex Elder <elder@linaro.org> Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
This commit is contained in:
parent
3a0e3c3efd
commit
5d2207e704
@ -35,7 +35,6 @@ static struct kmem_cache *gbuf_head_cache;
|
||||
* 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)
|
||||
@ -51,7 +50,6 @@ struct gbuf *greybus_alloc_gbuf(struct gb_operation *operation,
|
||||
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 */
|
||||
|
@ -118,11 +118,6 @@
|
||||
|
||||
*/
|
||||
|
||||
|
||||
struct gbuf;
|
||||
|
||||
typedef void (*gbuf_complete_t)(struct gbuf *gbuf);
|
||||
|
||||
struct gbuf {
|
||||
struct kref kref;
|
||||
|
||||
@ -134,7 +129,6 @@ struct gbuf {
|
||||
bool outbound; /* AP-relative data direction */
|
||||
|
||||
void *hcd_data; /* for the HCD to track the gbuf */
|
||||
gbuf_complete_t complete;
|
||||
};
|
||||
|
||||
|
||||
@ -193,8 +187,8 @@ void greybus_cport_in(struct greybus_host_device *hd, u16 cport_id,
|
||||
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
|
||||
|
@ -264,7 +264,7 @@ static void gb_operation_recv_work(struct work_struct *recv_work)
|
||||
gbuf = operation->request;
|
||||
else
|
||||
gbuf = operation->response;
|
||||
gbuf->complete(gbuf);
|
||||
gb_operation_gbuf_complete(gbuf);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -302,8 +302,7 @@ static struct gbuf *gb_operation_gbuf_create(struct gb_operation *operation,
|
||||
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;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user