From c149f8ffb2cbd1fa77f2c964bc547577835af647 Mon Sep 17 00:00:00 2001 From: Alex Elder Date: Thu, 16 Oct 2014 06:35:36 -0500 Subject: [PATCH] greybus: kill off gbuf work queue At this point all incoming messages are handled by the operation code, so this obviates the need for the gbuf workqueue. Signed-off-by: Alex Elder Signed-off-by: Greg Kroah-Hartman --- drivers/staging/greybus/gbuf.c | 25 +------------------------ drivers/staging/greybus/greybus.h | 1 - 2 files changed, 1 insertion(+), 25 deletions(-) diff --git a/drivers/staging/greybus/gbuf.c b/drivers/staging/greybus/gbuf.c index 97b45e9c84ba..12c8c23e23ab 100644 --- a/drivers/staging/greybus/gbuf.c +++ b/drivers/staging/greybus/gbuf.c @@ -15,17 +15,11 @@ #include #include #include -#include #include "greybus.h" -static void cport_process_event(struct work_struct *work); - static struct kmem_cache *gbuf_head_cache; -/* Workqueue to handle Greybus buffer completions. */ -static struct workqueue_struct *gbuf_workqueue; - /** * greybus_alloc_gbuf - allocate a greybus buffer * @@ -57,7 +51,6 @@ struct gbuf *greybus_alloc_gbuf(struct gb_connection *connection, kref_init(&gbuf->kref); gbuf->connection = connection; - INIT_WORK(&gbuf->event, cport_process_event); gbuf->outbound = outbound; gbuf->complete = complete; gbuf->context = context; @@ -114,15 +107,6 @@ int greybus_kill_gbuf(struct gbuf *gbuf) return -ENOMEM; } -static void cport_process_event(struct work_struct *work) -{ - struct gbuf *gbuf = container_of(work, struct gbuf, event); - - /* Call the completion handler, then drop our reference */ - gbuf->complete(gbuf); - greybus_put_gbuf(gbuf); -} - #define MAX_CPORTS 1024 struct gb_cport_handler { gbuf_complete_t handler; @@ -196,24 +180,18 @@ void greybus_cport_in(struct greybus_host_device *hd, u16 cport_id, */ memcpy(gbuf->transfer_buffer, data, length); gbuf->actual_length = length; - - queue_work(gbuf_workqueue, &gbuf->event); } 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) { - queue_work(gbuf_workqueue, &gbuf->event); + gbuf->complete(gbuf); } EXPORT_SYMBOL_GPL(greybus_gbuf_finished); int gb_gbuf_init(void) { - gbuf_workqueue = alloc_workqueue("greybus_gbuf", 0, 1); - if (!gbuf_workqueue) - return -ENOMEM; - gbuf_head_cache = kmem_cache_create("gbuf_head_cache", sizeof(struct gbuf), 0, 0, NULL); return 0; @@ -221,6 +199,5 @@ int gb_gbuf_init(void) void gb_gbuf_exit(void) { - destroy_workqueue(gbuf_workqueue); kmem_cache_destroy(gbuf_head_cache); } diff --git a/drivers/staging/greybus/greybus.h b/drivers/staging/greybus/greybus.h index d92ba5178cf1..854122b85cbe 100644 --- a/drivers/staging/greybus/greybus.h +++ b/drivers/staging/greybus/greybus.h @@ -134,7 +134,6 @@ struct gbuf { bool outbound; /* AP-relative data direction */ void *context; - struct work_struct event; gbuf_complete_t complete; }; -- 2.39.5