diff options
author | Johan Hovold <johan@hovoldconsulting.com> | 2016-01-21 17:34:26 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@google.com> | 2016-01-21 22:46:38 -0800 |
commit | 8eff5109616f4fb1784aa311b7544ef29b8deae9 (patch) | |
tree | 8db1af41f299dc7d514ff2bfa5d6dee4a70059dc /drivers/staging/greybus/firmware.c | |
parent | e0deb079edc9bd403acdb1ecada0879786cc0fe3 (diff) |
greybus: firmware: abort if AP_READY fails
Abort if the AP_READY request fails.
Also update the comment suggesting that this operation was a temporary
one.
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/firmware.c')
-rw-r--r-- | drivers/staging/greybus/firmware.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/drivers/staging/greybus/firmware.c b/drivers/staging/greybus/firmware.c index 6d8fd0ecbc1f..ee239a913e0c 100644 --- a/drivers/staging/greybus/firmware.c +++ b/drivers/staging/greybus/firmware.c @@ -251,25 +251,23 @@ static int gb_firmware_connection_init(struct gb_connection *connection) firmware_es2_fixup_vid_pid(firmware); - /* - * Module's Bootrom needs a way to know (currently), when to start - * sending requests to the AP. The version request is sent before this - * routine is called, and if the module sends the request right after - * receiving version request, the connection->private field will be - * NULL. - * - * Fix this TEMPORARILY by sending an AP_READY request. - */ + /* Tell bootrom we're ready. */ ret = gb_operation_sync(connection, GB_FIRMWARE_TYPE_AP_READY, NULL, 0, NULL, 0); if (ret) { dev_err(&connection->bundle->dev, "failed to send AP READY: %d\n", ret); + goto err_free_firmware; } dev_dbg(&connection->bundle->dev, "%s: AP_READY sent\n", __func__); return 0; + +err_free_firmware: + kfree(firmware); + + return ret; } static void gb_firmware_connection_exit(struct gb_connection *connection) |