From c5466ad343b65e856b799266d684930366b6463d Mon Sep 17 00:00:00 2001 From: Jagannadha Sutradharudu Teki Date: Wed, 15 May 2013 22:17:20 +0530 Subject: [PATCH] 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 --- drivers/mtd/spi/spi_flash.c | 11 +++-------- drivers/mtd/spi/spi_flash_internal.h | 4 ---- 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/drivers/mtd/spi/spi_flash.c b/drivers/mtd/spi/spi_flash.c index 2c62b54aa92..99e9f8e3cd2 100644 --- a/drivers/mtd/spi/spi_flash.c +++ b/drivers/mtd/spi/spi_flash.c @@ -232,12 +232,13 @@ int spi_flash_cmd_read_fast(struct spi_flash *flash, u32 offset, return ret; } -int spi_flash_cmd_poll_bit(struct spi_flash *flash, unsigned long timeout, - u8 cmd, u8 poll_bit) +int spi_flash_cmd_wait_ready(struct spi_flash *flash, unsigned long timeout) { unsigned long timebase; int ret; u8 status; + u8 poll_bit = STATUS_WIP; + u8 cmd = CMD_READ_STATUS; timebase = get_timer(0); do { @@ -262,12 +263,6 @@ int spi_flash_cmd_poll_bit(struct spi_flash *flash, unsigned long timeout, 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) { u32 start, end, erase_size; diff --git a/drivers/mtd/spi/spi_flash_internal.h b/drivers/mtd/spi/spi_flash_internal.h index 2a5e74cefc7..021d00976a7 100644 --- a/drivers/mtd/spi/spi_flash_internal.h +++ b/drivers/mtd/spi/spi_flash_internal.h @@ -101,10 +101,6 @@ int spi_flash_cmd_bankaddr_read(struct spi_flash *flash, int spi_flash_read_common(struct spi_flash *flash, const u8 *cmd, 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 * (write-in-progress) bit to clear itself. -- 2.47.3