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) ...@@ -344,43 +344,38 @@ static int gs_fpgaboot(void)
static int __init gs_fpgaboot_init(void) static int __init gs_fpgaboot_init(void)
{ {
int err, r; int err;
r = -1;
pr_info("FPGA DOWNLOAD --->\n"); pr_info("FPGA DOWNLOAD --->\n");
pr_info("FPGA image file name: %s\n", file); pr_info("FPGA image file name: %s\n", file);
err = init_driver(); err = init_driver();
if (err != 0) { if (err) {
pr_err("FPGA DRIVER INIT FAIL!!\n"); pr_err("FPGA DRIVER INIT FAIL!!\n");
return r; return err;
} }
err = xl_init_io(); err = xl_init_io();
if (err) { if (err) {
pr_err("GPIO INIT FAIL!!\n"); pr_err("GPIO INIT FAIL!!\n");
r = -1;
goto errout; goto errout;
} }
err = gs_fpgaboot(); err = gs_fpgaboot();
if (err) { if (err) {
pr_err("FPGA DOWNLOAD FAIL!!\n"); pr_err("FPGA DOWNLOAD FAIL!!\n");
r = -1;
goto errout; goto errout;
} }
pr_info("FPGA DOWNLOAD DONE <---\n"); pr_info("FPGA DOWNLOAD DONE <---\n");
r = 0; return 0;
return r;
errout: errout:
finish_driver(); finish_driver();
return r; return err;
} }
static void __exit gs_fpgaboot_exit(void) 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