From eecf6deb578a250fc3336286a0759281569966ec Mon Sep 17 00:00:00 2001 From: Alex Elder Date: Thu, 6 Nov 2014 07:01:04 -0600 Subject: [PATCH] greybus: get rid of greybus_gbuf_finished() All greybus_gbuf_finished() does is call the gbuf's complete method. Currently, greybus_gbuf_finished() is only ever called in one place, and that place can call the complete method directly instead. That allows us to eliminate greybus_gbuf_finished(). Signed-off-by: Alex Elder Signed-off-by: Greg Kroah-Hartman --- drivers/staging/greybus/gbuf.c | 7 ------- drivers/staging/greybus/greybus.h | 1 - drivers/staging/greybus/operation.c | 6 ++++-- 3 files changed, 4 insertions(+), 10 deletions(-) diff --git a/drivers/staging/greybus/gbuf.c b/drivers/staging/greybus/gbuf.c index af077ff..1e5562e 100644 --- a/drivers/staging/greybus/gbuf.c +++ b/drivers/staging/greybus/gbuf.c @@ -128,13 +128,6 @@ void greybus_cport_in(struct greybus_host_device *hd, u16 cport_id, } EXPORT_SYMBOL_GPL(greybus_cport_in); -/* Can be called in interrupt context, do the work and get out of here */ -void greybus_gbuf_finished(struct gbuf *gbuf) -{ - gbuf->complete(gbuf); -} -EXPORT_SYMBOL_GPL(greybus_gbuf_finished); - int gb_gbuf_init(void) { gbuf_head_cache = kmem_cache_create("gbuf_head_cache", diff --git a/drivers/staging/greybus/greybus.h b/drivers/staging/greybus/greybus.h index a4af64f..6f2369e 100644 --- a/drivers/staging/greybus/greybus.h +++ b/drivers/staging/greybus/greybus.h @@ -191,7 +191,6 @@ struct greybus_host_device *greybus_create_hd(struct greybus_host_driver *hd, void greybus_remove_hd(struct greybus_host_device *hd); void greybus_cport_in(struct greybus_host_device *hd, u16 cport_id, u8 *data, size_t length); -void greybus_gbuf_finished(struct gbuf *gbuf); struct gbuf *greybus_alloc_gbuf(struct gb_operation *operation, gbuf_complete_t complete, unsigned int size, diff --git a/drivers/staging/greybus/operation.c b/drivers/staging/greybus/operation.c index 575e586..6bb7568 100644 --- a/drivers/staging/greybus/operation.c +++ b/drivers/staging/greybus/operation.c @@ -207,6 +207,7 @@ out: static void gb_operation_recv_work(struct work_struct *recv_work) { struct gb_operation *operation; + struct gbuf *gbuf; bool incoming_request; operation = container_of(recv_work, struct gb_operation, recv_work); @@ -217,9 +218,10 @@ static void gb_operation_recv_work(struct work_struct *recv_work) /* We're finished with the buffer we read into */ if (incoming_request) - greybus_gbuf_finished(operation->request); + gbuf = operation->request; else - greybus_gbuf_finished(operation->response); + gbuf = operation->response; + gbuf->complete(gbuf); } /* -- 2.7.4