Commit 92bf93f1 authored by Devendra Naga's avatar Devendra Naga Committed by Greg Kroah-Hartman

staging: gs_fpgaboot: cleanup in gs_fpgaboot_init function

the error path is cleanup to return the correct (function call return value)
error code.
Signed-off-by: default avatarDevendra Naga <devendranaga4@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent e29d3ebc
......@@ -344,43 +344,38 @@ static int gs_fpgaboot(void)
static int __init gs_fpgaboot_init(void)
{
int err, r;
r = -1;
int err;
pr_info("FPGA DOWNLOAD --->\n");
pr_info("FPGA image file name: %s\n", file);
err = init_driver();
if (err != 0) {
if (err) {
pr_err("FPGA DRIVER INIT FAIL!!\n");
return r;
return err;
}
err = xl_init_io();
if (err) {
pr_err("GPIO INIT FAIL!!\n");
r = -1;
goto errout;
}
err = gs_fpgaboot();
if (err) {
pr_err("FPGA DOWNLOAD FAIL!!\n");
r = -1;
goto errout;
}
pr_info("FPGA DOWNLOAD DONE <---\n");
r = 0;
return r;
return 0;
errout:
finish_driver();
return r;
return err;
}
static void __exit gs_fpgaboot_exit(void)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment