From: Devendra Naga Date: Fri, 24 Oct 2014 20:31:54 +0000 (+0530) Subject: staging: gs_fpgaboot: cleanup in gs_fpgaboot_init function X-Git-Tag: v3.19-rc1~66^2~685 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=92bf93f1260402f17552f91599474bb9ead2a1b2;p=karo-tx-linux.git 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: Devendra Naga Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/gs_fpgaboot/gs_fpgaboot.c b/drivers/staging/gs_fpgaboot/gs_fpgaboot.c index 0c18c4c311b4..bf2f898d3853 100644 --- a/drivers/staging/gs_fpgaboot/gs_fpgaboot.c +++ b/drivers/staging/gs_fpgaboot/gs_fpgaboot.c @@ -344,43 +344,38 @@ err_out1: 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)