]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
greybus: kill off gbuf work queue
authorAlex Elder <elder@linaro.org>
Thu, 16 Oct 2014 11:35:36 +0000 (06:35 -0500)
committerGreg Kroah-Hartman <greg@kroah.com>
Fri, 17 Oct 2014 16:14:11 +0000 (18:14 +0200)
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 <elder@linaro.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
drivers/staging/greybus/gbuf.c
drivers/staging/greybus/greybus.h

index 97b45e9c84ba8dad32882dfc7ad874dcd14f09b5..12c8c23e23ab9f6deea8443aba61fa4f88018a9d 100644 (file)
 #include <linux/kref.h>
 #include <linux/device.h>
 #include <linux/slab.h>
-#include <linux/workqueue.h>
 
 #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);
 }
index d92ba5178cf158f021eb7072c9651c70e2963d1a..854122b85cbe0a7cbf77b7734ac83a80401ca129 100644 (file)
@@ -134,7 +134,6 @@ struct gbuf {
        bool outbound;                  /* AP-relative data direction */
 
        void *context;
-       struct work_struct event;
        gbuf_complete_t complete;
 };