greybus: kill off the last of gbuf.c
authorAlex Elder <elder@linaro.org>
Tue, 18 Nov 2014 00:08:37 +0000 (18:08 -0600)
committerGreg Kroah-Hartman <greg@kroah.com>
Tue, 18 Nov 2014 01:19:20 +0000 (17:19 -0800)
Only three functions remain in "gbuf.c".  Move one of them into
"connection.c" and the other two into "operation.c".

Some more cleanup is coming that will further straighten out gbufs
but for now there's no sense in drawing this out any longer.

Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
drivers/staging/greybus/Makefile
drivers/staging/greybus/connection.c
drivers/staging/greybus/connection.h
drivers/staging/greybus/gbuf.c [deleted file]
drivers/staging/greybus/greybus.h
drivers/staging/greybus/operation.c

index 7ec70fe6bd5dad9789f61b834d86ae80ba7f64cf..c19fc84a724bd60c590c647c739d96dc20b50587 100644 (file)
@@ -1,5 +1,4 @@
 greybus-y :=   core.o          \
-               gbuf.o          \
                sysfs.o         \
                debugfs.o       \
                ap.o            \
index cb6e2e1c085c761089be24454be904690d861f91..258d96cdba671cdc905b25c99dfe431837212f20 100644 (file)
@@ -29,6 +29,21 @@ struct gb_connection *gb_hd_connection_find(struct greybus_host_device *hd,
        return connection;
 }
 
+void greybus_cport_in(struct greybus_host_device *hd, u16 cport_id,
+                       u8 *data, size_t length)
+{
+       struct gb_connection *connection;
+
+       connection = gb_hd_connection_find(hd, cport_id);
+       if (!connection) {
+               dev_err(hd->parent,
+                       "nonexistent connection (%zu bytes dropped)\n", length);
+               return;
+       }
+       gb_connection_operation_recv(connection, data, length);
+}
+EXPORT_SYMBOL_GPL(greybus_cport_in);
+
 /*
  * Allocate an available CPort Id for use for the host side of the
  * given connection.  The lowest-available id is returned, so the
index 5e969672b7938ac444c45db3791aa417188214aa..bcaad47aaa037e374990db12200431446ede23dd 100644 (file)
@@ -53,6 +53,8 @@ void gb_connection_exit(struct gb_connection *connection);
 struct gb_connection *gb_hd_connection_find(struct greybus_host_device *hd,
                                u16 cport_id);
 
+void greybus_cport_in(struct greybus_host_device *hd, u16 cport_id,
+                       u8 *data, size_t length);
 __printf(2, 3)
 void gb_connection_err(struct gb_connection *connection, const char *fmt, ...);
 
diff --git a/drivers/staging/greybus/gbuf.c b/drivers/staging/greybus/gbuf.c
deleted file mode 100644 (file)
index d47cf36..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Greybus gbuf handling
- *
- * Copyright 2014 Google Inc.
- *
- * Released under the GPLv2 only.
- */
-
-#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
-
-#include <linux/types.h>
-#include <linux/module.h>
-#include <linux/moduleparam.h>
-#include <linux/kernel.h>
-#include <linux/device.h>
-
-#include "greybus.h"
-
-int greybus_submit_gbuf(struct gbuf *gbuf, gfp_t gfp_mask)
-{
-       gbuf->status = -EINPROGRESS;
-
-       return gbuf->hd->driver->submit_gbuf(gbuf, gfp_mask);
-}
-
-void greybus_kill_gbuf(struct gbuf *gbuf)
-{
-       if (gbuf->status != -EINPROGRESS)
-               return;
-
-       gbuf->hd->driver->kill_gbuf(gbuf);
-}
-
-void greybus_cport_in(struct greybus_host_device *hd, u16 cport_id,
-                       u8 *data, size_t length)
-{
-       struct gb_connection *connection;
-
-       connection = gb_hd_connection_find(hd, cport_id);
-       if (!connection) {
-               dev_err(hd->parent,
-                       "nonexistent connection (%zu bytes dropped)\n", length);
-               return;
-       }
-       gb_connection_operation_recv(connection, data, length);
-}
-EXPORT_SYMBOL_GPL(greybus_cport_in);
index 30d5625ea4ff80b4f6960451b56fc886dd4d5327..301bd4598c117241fde4a36601e9bd3e1e8226bb 100644 (file)
@@ -102,12 +102,6 @@ struct greybus_host_device {
 struct greybus_host_device *greybus_create_hd(struct greybus_host_driver *hd,
                                              struct device *parent);
 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);
-
-int greybus_submit_gbuf(struct gbuf *gbuf, gfp_t mem_flags);
-void greybus_kill_gbuf(struct gbuf *gbuf);
-
 
 struct greybus_driver {
        const char *name;
index 7eaea71f86049ad11cbd94e0c1897ffff32b2491..22398832779571bfc938fe2d107dc3ebf8827880 100644 (file)
@@ -103,6 +103,20 @@ gb_pending_operation_find(struct gb_connection *connection, u16 id)
        return found ? operation : NULL;
 }
 
+static int greybus_submit_gbuf(struct gbuf *gbuf, gfp_t gfp_mask)
+{
+       gbuf->status = -EINPROGRESS;
+
+       return gbuf->hd->driver->submit_gbuf(gbuf, gfp_mask);
+}
+
+static void greybus_kill_gbuf(struct gbuf *gbuf)
+{
+       if (gbuf->status != -EINPROGRESS)
+               return;
+
+       gbuf->hd->driver->kill_gbuf(gbuf);
+}
 /*
  * An operations's response message has arrived.  If no callback was
  * supplied it was submitted for asynchronous completion, so we notify