mirror of
				https://github.com/smaeul/u-boot.git
				synced 2025-11-04 14:00:19 +00:00 
			
		
		
		
	cmd: fpga: Cleanup error handling in connection to FPGA_NONE
Incorrect command is already handled and FPGA_NONE should be used only one. In case of error CMD_RET_USAGE can be returned directly without any addition logic around. Signed-off-by: Michal Simek <michal.simek@xilinx.com> Reviewed-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
		
							parent
							
								
									323fe38e74
								
							
						
					
					
						commit
						ccd6520327
					
				@ -171,11 +171,10 @@ int do_fpga(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	if (dev == FPGA_INVALID_DEVICE) {
 | 
						if (dev == FPGA_INVALID_DEVICE) {
 | 
				
			||||||
		puts("FPGA device not specified\n");
 | 
							puts("FPGA device not specified\n");
 | 
				
			||||||
		op = FPGA_NONE;
 | 
							return CMD_RET_USAGE;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	switch (op) {
 | 
						switch (op) {
 | 
				
			||||||
	case FPGA_NONE:
 | 
					 | 
				
			||||||
	case FPGA_INFO:
 | 
						case FPGA_INFO:
 | 
				
			||||||
		break;
 | 
							break;
 | 
				
			||||||
#if defined(CONFIG_CMD_FPGA_LOADFS)
 | 
					#if defined(CONFIG_CMD_FPGA_LOADFS)
 | 
				
			||||||
@ -219,13 +218,10 @@ int do_fpga(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	if (wrong_parms) {
 | 
						if (wrong_parms) {
 | 
				
			||||||
		puts("Wrong parameters for FPGA request\n");
 | 
							puts("Wrong parameters for FPGA request\n");
 | 
				
			||||||
		op = FPGA_NONE;
 | 
							return CMD_RET_USAGE;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	switch (op) {
 | 
						switch (op) {
 | 
				
			||||||
	case FPGA_NONE:
 | 
					 | 
				
			||||||
		return CMD_RET_USAGE;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	case FPGA_INFO:
 | 
						case FPGA_INFO:
 | 
				
			||||||
		rc = fpga_info(dev);
 | 
							rc = fpga_info(dev);
 | 
				
			||||||
		break;
 | 
							break;
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user