From: Alex Elder Date: Thu, 6 Nov 2014 13:01:06 +0000 (-0600) Subject: greybus: kill gbuf->complete X-Git-Tag: v5.15~12752^2~378^2~21^2~1924 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5d2207e7047ebd110307f5f60c440f7119f999b8;p=platform%2Fkernel%2Flinux-starfive.git 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 Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/greybus/gbuf.c b/drivers/staging/greybus/gbuf.c index 1e5562e..8b5a438 100644 --- a/drivers/staging/greybus/gbuf.c +++ b/drivers/staging/greybus/gbuf.c @@ -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 */ diff --git a/drivers/staging/greybus/greybus.h b/drivers/staging/greybus/greybus.h index 6f2369e..296a6a2 100644 --- a/drivers/staging/greybus/greybus.h +++ b/drivers/staging/greybus/greybus.h @@ -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 diff --git a/drivers/staging/greybus/operation.c b/drivers/staging/greybus/operation.c index 16ee7ce..302ab00 100644 --- a/drivers/staging/greybus/operation.c +++ b/drivers/staging/greybus/operation.c @@ -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;