diff options
author | Marek Vasut <marex@denx.de> | 2014-09-16 20:29:24 +0200 |
---|---|---|
committer | Marek Vasut <marex@denx.de> | 2014-10-06 17:31:41 +0200 |
commit | 4a4c0a5e9a2b65711f733bc2178e506131b0693b (patch) | |
tree | 79974b55098682ffb42b827428e0bb42315b3e3a /drivers/fpga | |
parent | 5561a841487fa246ebc6df17bed8eabfa33f3557 (diff) | |
download | u-boot-4a4c0a5e9a2b65711f733bc2178e506131b0693b.tar.gz u-boot-4a4c0a5e9a2b65711f733bc2178e506131b0693b.tar.bz2 u-boot-4a4c0a5e9a2b65711f733bc2178e506131b0693b.zip |
fpga: altera: More indentation trimdown
Further improve the indentation in the rest of the file, where
the indentation is initially a bit less brutal. There is no
functional change in this patch.
Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Chin Liang See <clsee@altera.com>
Cc: Dinh Nguyen <dinguyen@altera.com>
Cc: Albert Aribaud <albert.u.boot@aribaud.net>
Cc: Tom Rini <trini@ti.com>
Cc: Wolfgang Denk <wd@denx.de>
Cc: Pavel Machek <pavel@denx.de>
Acked-by: Pavel Machek <pavel@denx.de>
Diffstat (limited to 'drivers/fpga')
-rw-r--r-- | drivers/fpga/altera.c | 238 |
1 files changed, 120 insertions, 118 deletions
diff --git a/drivers/fpga/altera.c b/drivers/fpga/altera.c index 6394afe095..b0f323fbef 100644 --- a/drivers/fpga/altera.c +++ b/drivers/fpga/altera.c @@ -26,40 +26,41 @@ int altera_load(Altera_desc *desc, const void *buf, size_t bsize) { int ret_val = FPGA_FAIL; /* assume a failure */ - if (!altera_validate (desc, (char *)__func__)) { + if (!altera_validate(desc, (char *)__func__)) { printf("%s: Invalid device descriptor\n", __func__); - } else { - switch (desc->family) { - case Altera_ACEX1K: - case Altera_CYC2: + return FPGA_FAIL; + } + + switch (desc->family) { + case Altera_ACEX1K: + case Altera_CYC2: #if defined(CONFIG_FPGA_ACEX1K) - debug_cond(FPGA_DEBUG, - "%s: Launching the ACEX1K Loader...\n", - __func__); - ret_val = ACEX1K_load (desc, buf, bsize); + debug_cond(FPGA_DEBUG, + "%s: Launching the ACEX1K Loader...\n", + __func__); + ret_val = ACEX1K_load (desc, buf, bsize); #elif defined(CONFIG_FPGA_CYCLON2) - debug_cond(FPGA_DEBUG, - "%s: Launching the CYCLONE II Loader...\n", - __func__); - ret_val = CYC2_load (desc, buf, bsize); + debug_cond(FPGA_DEBUG, + "%s: Launching the CYCLONE II Loader...\n", + __func__); + ret_val = CYC2_load (desc, buf, bsize); #else - printf("%s: No support for ACEX1K devices.\n", - __func__); + printf("%s: No support for ACEX1K devices.\n", + __func__); #endif - break; + break; #if defined(CONFIG_FPGA_STRATIX_II) - case Altera_StratixII: - debug_cond(FPGA_DEBUG, - "%s: Launching the Stratix II Loader...\n", - __func__); - ret_val = StratixII_load (desc, buf, bsize); - break; + case Altera_StratixII: + debug_cond(FPGA_DEBUG, + "%s: Launching the Stratix II Loader...\n", + __func__); + ret_val = StratixII_load (desc, buf, bsize); + break; #endif - default: - printf("%s: Unsupported family type, %d\n", - __func__, desc->family); - } + default: + printf("%s: Unsupported family type, %d\n", + __func__, desc->family); } return ret_val; @@ -71,125 +72,126 @@ int altera_dump(Altera_desc *desc, const void *buf, size_t bsize) if (!altera_validate (desc, (char *)__func__)) { printf("%s: Invalid device descriptor\n", __func__); - } else { - switch (desc->family) { - case Altera_ACEX1K: + return FPGA_FAIL; + } + + switch (desc->family) { + case Altera_ACEX1K: #if defined(CONFIG_FPGA_ACEX) - debug_cond(FPGA_DEBUG, - "%s: Launching the ACEX1K Reader...\n", - __func__); - ret_val = ACEX1K_dump (desc, buf, bsize); + debug_cond(FPGA_DEBUG, + "%s: Launching the ACEX1K Reader...\n", + __func__); + ret_val = ACEX1K_dump (desc, buf, bsize); #else - printf("%s: No support for ACEX1K devices.\n", - __func__); + printf("%s: No support for ACEX1K devices.\n", + __func__); #endif - break; + break; #if defined(CONFIG_FPGA_STRATIX_II) - case Altera_StratixII: - debug_cond(FPGA_DEBUG, - "%s: Launching the Stratix II Reader...\n", - __func__); - ret_val = StratixII_dump (desc, buf, bsize); - break; + case Altera_StratixII: + debug_cond(FPGA_DEBUG, + "%s: Launching the Stratix II Reader...\n", + __func__); + ret_val = StratixII_dump (desc, buf, bsize); + break; #endif - default: - printf("%s: Unsupported family type, %d\n", - __func__, desc->family); - } + default: + printf("%s: Unsupported family type, %d\n", + __func__, desc->family); } return ret_val; } -int altera_info( Altera_desc *desc ) +int altera_info(Altera_desc *desc) { int ret_val = FPGA_FAIL; - if (altera_validate (desc, (char *)__func__)) { - printf("Family: \t"); - switch (desc->family) { - case Altera_ACEX1K: - printf("ACEX1K\n"); - break; - case Altera_CYC2: - printf("CYCLON II\n"); - break; - case Altera_StratixII: - printf("Stratix II\n"); - break; - /* Add new family types here */ - default: - printf("Unknown family type, %d\n", desc->family); - } + if (!altera_validate (desc, (char *)__func__)) { + printf("%s: Invalid device descriptor\n", __func__); + return FPGA_FAIL; + } - printf("Interface type:\t"); - switch (desc->iface) { - case passive_serial: - printf("Passive Serial (PS)\n"); - break; - case passive_parallel_synchronous: - printf("Passive Parallel Synchronous (PPS)\n"); - break; - case passive_parallel_asynchronous: - printf("Passive Parallel Asynchronous (PPA)\n"); - break; - case passive_serial_asynchronous: - printf("Passive Serial Asynchronous (PSA)\n"); - break; - case altera_jtag_mode: /* Not used */ - printf("JTAG Mode\n"); - break; - case fast_passive_parallel: - printf("Fast Passive Parallel (FPP)\n"); - break; - case fast_passive_parallel_security: - printf - ("Fast Passive Parallel with Security (FPPS) \n"); - break; - /* Add new interface types here */ - default: - printf("Unsupported interface type, %d\n", desc->iface); - } + printf("Family: \t"); + switch (desc->family) { + case Altera_ACEX1K: + printf("ACEX1K\n"); + break; + case Altera_CYC2: + printf("CYCLON II\n"); + break; + case Altera_StratixII: + printf("Stratix II\n"); + break; + /* Add new family types here */ + default: + printf("Unknown family type, %d\n", desc->family); + } - printf("Device Size: \t%zd bytes\n" - "Cookie: \t0x%x (%d)\n", - desc->size, desc->cookie, desc->cookie); + printf("Interface type:\t"); + switch (desc->iface) { + case passive_serial: + printf("Passive Serial (PS)\n"); + break; + case passive_parallel_synchronous: + printf("Passive Parallel Synchronous (PPS)\n"); + break; + case passive_parallel_asynchronous: + printf("Passive Parallel Asynchronous (PPA)\n"); + break; + case passive_serial_asynchronous: + printf("Passive Serial Asynchronous (PSA)\n"); + break; + case altera_jtag_mode: /* Not used */ + printf("JTAG Mode\n"); + break; + case fast_passive_parallel: + printf("Fast Passive Parallel (FPP)\n"); + break; + case fast_passive_parallel_security: + printf("Fast Passive Parallel with Security (FPPS)\n"); + break; + /* Add new interface types here */ + default: + printf("Unsupported interface type, %d\n", desc->iface); + } + + printf("Device Size: \t%zd bytes\n" + "Cookie: \t0x%x (%d)\n", + desc->size, desc->cookie, desc->cookie); - if (desc->iface_fns) { - printf("Device Function Table @ 0x%p\n", desc->iface_fns); - switch (desc->family) { - case Altera_ACEX1K: - case Altera_CYC2: + if (desc->iface_fns) { + printf("Device Function Table @ 0x%p\n", desc->iface_fns); + switch (desc->family) { + case Altera_ACEX1K: + case Altera_CYC2: #if defined(CONFIG_FPGA_ACEX1K) - ACEX1K_info(desc); + ACEX1K_info(desc); #elif defined(CONFIG_FPGA_CYCLON2) - CYC2_info(desc); + CYC2_info(desc); #else - /* just in case */ - printf("%s: No support for ACEX1K devices.\n", - __func__); + /* just in case */ + printf("%s: No support for ACEX1K devices.\n", + __func__); #endif - break; + break; #if defined(CONFIG_FPGA_STRATIX_II) - case Altera_StratixII: - StratixII_info(desc); - break; + case Altera_StratixII: + StratixII_info(desc); + break; #endif - /* Add new family types here */ - default: - /* we don't need a message here - we give one up above */ - break; - } - } else { - printf("No Device Function Table.\n"); + /* Add new family types here */ + default: + /* we don't need a message here - we give one up above */ + break; } - - ret_val = FPGA_SUCCESS; } else { - printf("%s: Invalid device descriptor\n", __func__); + printf("No Device Function Table.\n"); } + ret_val = FPGA_SUCCESS; + return ret_val; } |