sf: Remove spi_flash_cmd_poll_bit()
There is no other call other than spi_flash_cmd_wait_ready(), hence removed spi_flash_cmd_poll_bit and use the poll status code spi_flash_cmd_wait_ready() itself. Signed-off-by: Jagannadha Sutradharudu Teki <jaganna@xilinx.com> Reviewed-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
		
							parent
							
								
									76e98d4817
								
							
						
					
					
						commit
						ba549de6c5
					
				| 
						 | 
					@ -194,13 +194,14 @@ int spi_flash_cmd_read_fast(struct spi_flash *flash, u32 offset,
 | 
				
			||||||
	return ret;
 | 
						return ret;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
int spi_flash_cmd_poll_bit(struct spi_flash *flash, unsigned long timeout,
 | 
					int spi_flash_cmd_wait_ready(struct spi_flash *flash, unsigned long timeout)
 | 
				
			||||||
			   u8 cmd, u8 poll_bit)
 | 
					 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	struct spi_slave *spi = flash->spi;
 | 
						struct spi_slave *spi = flash->spi;
 | 
				
			||||||
	unsigned long timebase;
 | 
						unsigned long timebase;
 | 
				
			||||||
	int ret;
 | 
						int ret;
 | 
				
			||||||
	u8 status;
 | 
						u8 status;
 | 
				
			||||||
 | 
						u8 poll_bit = STATUS_WIP;
 | 
				
			||||||
 | 
						u8 cmd = CMD_READ_STATUS;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	ret = spi_xfer(spi, 8, &cmd, NULL, SPI_XFER_BEGIN);
 | 
						ret = spi_xfer(spi, 8, &cmd, NULL, SPI_XFER_BEGIN);
 | 
				
			||||||
	if (ret) {
 | 
						if (ret) {
 | 
				
			||||||
| 
						 | 
					@ -231,12 +232,6 @@ int spi_flash_cmd_poll_bit(struct spi_flash *flash, unsigned long timeout,
 | 
				
			||||||
	return -1;
 | 
						return -1;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
int spi_flash_cmd_wait_ready(struct spi_flash *flash, unsigned long timeout)
 | 
					 | 
				
			||||||
{
 | 
					 | 
				
			||||||
	return spi_flash_cmd_poll_bit(flash, timeout,
 | 
					 | 
				
			||||||
		CMD_READ_STATUS, STATUS_WIP);
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
int spi_flash_cmd_erase(struct spi_flash *flash, u32 offset, size_t len)
 | 
					int spi_flash_cmd_erase(struct spi_flash *flash, u32 offset, size_t len)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	u32 erase_size;
 | 
						u32 erase_size;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -107,10 +107,6 @@ int spi_flash_bank_config(struct spi_flash *flash, u8 idcode0);
 | 
				
			||||||
int spi_flash_read_common(struct spi_flash *flash, const u8 *cmd,
 | 
					int spi_flash_read_common(struct spi_flash *flash, const u8 *cmd,
 | 
				
			||||||
		size_t cmd_len, void *data, size_t data_len);
 | 
							size_t cmd_len, void *data, size_t data_len);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Send a command to the device and wait for some bit to clear itself. */
 | 
					 | 
				
			||||||
int spi_flash_cmd_poll_bit(struct spi_flash *flash, unsigned long timeout,
 | 
					 | 
				
			||||||
			   u8 cmd, u8 poll_bit);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
 * Send the read status command to the device and wait for the wip
 | 
					 * Send the read status command to the device and wait for the wip
 | 
				
			||||||
 * (write-in-progress) bit to clear itself.
 | 
					 * (write-in-progress) bit to clear itself.
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue