summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorAlex Elder <elder@linaro.org>2015-06-09 17:42:51 -0500
committerGreg Kroah-Hartman <gregkh@google.com>2015-06-10 10:38:23 -0700
commitf35ab903ef6dad781a3de25ab37850499d2a39d4 (patch)
tree76a39a932f61865a965a43618ef0a793dbe6befd /drivers
parent47ed2c92406f94ac0f122ebf0e05fc63d3f0c02a (diff)
greybus: endo: define endo_init() and endo_exit()
Define init and exit functions to do one-time setup and teardown of endo-related functionality. Currently they're place holders; the next patch will populate them. Note that we now call gb_operation_exit() from gb_init(), so we can no longer mark that function with __exit. Signed-off-by: Alex Elder <elder@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/staging/greybus/core.c16
-rw-r--r--drivers/staging/greybus/endo.c8
-rw-r--r--drivers/staging/greybus/endo.h3
-rw-r--r--drivers/staging/greybus/operation.c2
-rw-r--r--drivers/staging/greybus/operation.h2
5 files changed, 25 insertions, 6 deletions
diff --git a/drivers/staging/greybus/core.c b/drivers/staging/greybus/core.c
index e7a280cfbe81..8da120bcdf3d 100644
--- a/drivers/staging/greybus/core.c
+++ b/drivers/staging/greybus/core.c
@@ -252,7 +252,7 @@ static int __init gb_init(void)
retval = bus_register(&greybus_bus_type);
if (retval) {
- pr_err("bus_register failed\n");
+ pr_err("bus_register failed (%d)\n", retval);
goto error_bus;
}
@@ -260,18 +260,26 @@ static int __init gb_init(void)
retval = gb_ap_init();
if (retval) {
- pr_err("gb_ap_init failed\n");
+ pr_err("gb_ap_init failed (%d)\n", retval);
goto error_ap;
}
retval = gb_operation_init();
if (retval) {
- pr_err("gb_operation_init failed\n");
+ pr_err("gb_operation_init failed (%d)\n", retval);
goto error_operation;
}
+ retval = gb_endo_init();
+ if (retval) {
+ pr_err("gb_endo_init failed (%d)\n", retval);
+ goto error_endo;
+ }
+
return 0; /* Success */
+error_endo:
+ gb_operation_exit();
error_operation:
gb_ap_exit();
error_ap:
@@ -285,12 +293,12 @@ module_init(gb_init);
static void __exit gb_exit(void)
{
+ gb_endo_exit();
gb_operation_exit();
gb_ap_exit();
bus_unregister(&greybus_bus_type);
gb_debugfs_cleanup();
}
module_exit(gb_exit);
-
MODULE_LICENSE("GPL v2");
MODULE_AUTHOR("Greg Kroah-Hartman <gregkh@linuxfoundation.org>");
diff --git a/drivers/staging/greybus/endo.c b/drivers/staging/greybus/endo.c
index b89b14f59fb2..37bd8ae15bfe 100644
--- a/drivers/staging/greybus/endo.c
+++ b/drivers/staging/greybus/endo.c
@@ -551,3 +551,11 @@ void gb_endo_remove(struct gb_endo *endo)
device_unregister(&endo->dev);
}
+int __init gb_endo_init(void)
+{
+ return 0;
+}
+
+void __exit gb_endo_exit(void)
+{
+}
diff --git a/drivers/staging/greybus/endo.h b/drivers/staging/greybus/endo.h
index 63dbadf5589f..0ff40e990ab8 100644
--- a/drivers/staging/greybus/endo.h
+++ b/drivers/staging/greybus/endo.h
@@ -51,6 +51,9 @@ extern struct ida greybus_endo_id_map;
/* Greybus "private" definitions */
struct greybus_host_device;
+int gb_endo_init(void) __init;
+void gb_endo_exit(void) __exit;
+
struct gb_endo *gb_endo_create(struct greybus_host_device *hd,
u16 endo_id, u8 ap_intf_id);
void gb_endo_remove(struct gb_endo *endo);
diff --git a/drivers/staging/greybus/operation.c b/drivers/staging/greybus/operation.c
index 49bc628e621b..a713dafabf6e 100644
--- a/drivers/staging/greybus/operation.c
+++ b/drivers/staging/greybus/operation.c
@@ -959,7 +959,7 @@ err_destroy_message_cache:
return -ENOMEM;
}
-void __exit gb_operation_exit(void)
+void gb_operation_exit(void)
{
destroy_workqueue(gb_operation_workqueue);
gb_operation_workqueue = NULL;
diff --git a/drivers/staging/greybus/operation.h b/drivers/staging/greybus/operation.h
index fcd6566f4bc8..6eed6bc62148 100644
--- a/drivers/staging/greybus/operation.h
+++ b/drivers/staging/greybus/operation.h
@@ -159,6 +159,6 @@ int gb_operation_sync(struct gb_connection *connection, int type,
void *response, int response_size);
int gb_operation_init(void) __init;
-void gb_operation_exit(void) __exit;
+void gb_operation_exit(void);
#endif /* !__OPERATION_H */