summaryrefslogtreecommitdiff
path: root/drivers/staging/greybus/core.c
diff options
context:
space:
mode:
authorJohan Hovold <johan@hovoldconsulting.com>2016-01-19 12:50:59 +0100
committerGreg Kroah-Hartman <gregkh@google.com>2016-01-19 12:12:40 -0800
commit5dda7e5a484295f24ecfcba6b64da6d37dccb912 (patch)
tree26040d496fb56eb285b3939677d59995f89d02a5 /drivers/staging/greybus/core.c
parent5b0327103ff0f5498af008cb7189770c1a33b67b (diff)
greybus: legacy: add legacy-protocol bundle driver
Add the first Greybus bundle driver that will be used when transitioning from legacy Greybus protocols to bundle drivers. The legacy-protocol driver initially binds to all current bundle classes. In order to avoid having to update current module-loading scripts, keep this driver internal to greybus core at least until modalias support is added. Note that this prevents unloading any protocol drivers without first tearing down the host device due to a circular module dependency. Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Diffstat (limited to 'drivers/staging/greybus/core.c')
-rw-r--r--drivers/staging/greybus/core.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/staging/greybus/core.c b/drivers/staging/greybus/core.c
index 0e2f99df6cfa..28f48d79b005 100644
--- a/drivers/staging/greybus/core.c
+++ b/drivers/staging/greybus/core.c
@@ -12,6 +12,7 @@
#define CREATE_TRACE_POINTS
#include "greybus.h"
#include "greybus_trace.h"
+#include "legacy.h"
EXPORT_TRACEPOINT_SYMBOL_GPL(gb_host_device_send);
EXPORT_TRACEPOINT_SYMBOL_GPL(gb_host_device_recv);
@@ -240,8 +241,16 @@ static int __init gb_init(void)
goto error_firmware;
}
+ retval = gb_legacy_init();
+ if (retval) {
+ pr_err("gb_legacy_init failed\n");
+ goto error_legacy;
+ }
+
return 0; /* Success */
+error_legacy:
+ gb_firmware_protocol_exit();
error_firmware:
gb_svc_protocol_exit();
error_svc:
@@ -261,6 +270,7 @@ module_init(gb_init);
static void __exit gb_exit(void)
{
+ gb_legacy_exit();
gb_firmware_protocol_exit();
gb_svc_protocol_exit();
gb_control_protocol_exit();