summaryrefslogtreecommitdiff
path: root/drivers/staging/greybus/core.c
diff options
context:
space:
mode:
authorJohan Hovold <johan@hovoldconsulting.com>2016-01-29 15:42:31 +0100
committerGreg Kroah-Hartman <gregkh@google.com>2016-02-01 17:52:20 -0800
commit8ec589b9796eebfa266d2b047ee2318541814e28 (patch)
tree6e4b821bd77f9a507bc7e1ebaabf5c5e038038f6 /drivers/staging/greybus/core.c
parentc760442e1cafef30de20ea5b64074d70efa6eec2 (diff)
greybus: firmware: convert to bundle driver
Convert the legacy firmware protocol driver to a bundle driver. This also fixes a potential crash should a (malicious) module have sent an early request before the private data had been initialised. Note that the firmware protocol needs to support the version request indefinitely since it has been burnt into ROM. 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 there is no MODULE_DEVICE_TABLE defined for firmware as we cannot have two greybus tables in one module on ancient 3.10 kernels and that the legacy driver is currently also internal to core. This needs be added once the driver can be built as a module. Testing Done: Tested on DB3. 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.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/staging/greybus/core.c b/drivers/staging/greybus/core.c
index b9303c0cd5e4..2fb95744e01c 100644
--- a/drivers/staging/greybus/core.c
+++ b/drivers/staging/greybus/core.c
@@ -10,6 +10,7 @@
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#define CREATE_TRACE_POINTS
+#include "firmware.h"
#include "greybus.h"
#include "greybus_trace.h"
#include "legacy.h"
@@ -243,9 +244,9 @@ static int __init gb_init(void)
goto error_operation;
}
- retval = gb_firmware_protocol_init();
+ retval = gb_firmware_init();
if (retval) {
- pr_err("gb_firmware_protocol_init failed\n");
+ pr_err("gb_firmware_init failed\n");
goto error_firmware;
}
@@ -258,7 +259,7 @@ static int __init gb_init(void)
return 0; /* Success */
error_legacy:
- gb_firmware_protocol_exit();
+ gb_firmware_exit();
error_firmware:
gb_operation_exit();
error_operation:
@@ -275,7 +276,7 @@ module_init(gb_init);
static void __exit gb_exit(void)
{
gb_legacy_exit();
- gb_firmware_protocol_exit();
+ gb_firmware_exit();
gb_operation_exit();
gb_hd_exit();
bus_unregister(&greybus_bus_type);