[U-Boot] [PATCH v7 10/34] sf: Use static for file-scope functions

Jagan Teki
2015-11-26T12:03:54Z

Use static for file-scope functions and removed
them from header files.

Signed-off-by: Jagan Teki <jteki@openedev.com>
---
drivers/mtd/spi/sf_internal.h | 21 ---------------------
drivers/mtd/spi/sf_ops.c | 11 ++++++-----
2 files changed, 6 insertions(+), 26 deletions(-)

diff --git a/drivers/mtd/spi/sf_internal.h b/drivers/mtd/spi/sf_internal.h
index b8692c6..acf76e1 100644
--- a/drivers/mtd/spi/sf_internal.h
+++ b/drivers/mtd/spi/sf_internal.h
@@ -120,11 +120,6 @@ enum spi_nor_option_flags {
#ifdef CONFIG_SPI_FLASH_SST
# define CMD_SST_BP 0x02 /* Byte Program */
# define CMD_SST_AAI_WP 0xAD /* Auto Address Incr Word Program */
-
-int sst_write_wp(struct spi_flash *flash, u32 offset, size_t len,
- const void *buf);
-int sst_write_bp(struct spi_flash *flash, u32 offset, size_t len,
- const void *buf);
#endif

/**
@@ -168,10 +163,6 @@ int spi_flash_cmd_read(struct spi_slave *spi, const u8 *cmd,
int spi_flash_cmd_write(struct spi_slave *spi, const u8 *cmd, size_t cmd_len,
const void *data, size_t data_len);

-
-/* Flash erase(sectors) operation, support all possible erase commands */
-int spi_flash_cmd_erase_ops(struct spi_flash *flash, u32 offset, size_t len);
-
/* Lock stmicro spi flash region */
int stm_lock(struct spi_flash *flash, u32 ofs, size_t len);

@@ -205,24 +196,12 @@ int spi_flash_write_common(struct spi_flash *flash, const u8 *cmd,
size_t cmd_len, const void *buf, size_t buf_len);

/*
- * Flash write operation, support all possible write commands.
- * Write the requested data out breaking it up into multiple write
- * commands as needed per the write size.
- */
-int spi_flash_cmd_write_ops(struct spi_flash *flash, u32 offset,
- size_t len, const void *buf);
-
-/*
* Same as spi_flash_cmd_read() except it also claims/releases the SPI
* bus. Used as common part of the ->read() operation.
*/
int spi_flash_read_common(struct spi_flash *flash, const u8 *cmd,
size_t cmd_len, void *data, size_t data_len);

-/* Flash read operation, support all possible read commands */
-int spi_flash_cmd_read_ops(struct spi_flash *flash, u32 offset,
- size_t len, void *data);
-
#ifdef CONFIG_SPI_FLASH_MTD
int spi_flash_mtd_register(struct spi_flash *flash);
void spi_flash_mtd_unregister(void);
diff --git a/drivers/mtd/spi/sf_ops.c b/drivers/mtd/spi/sf_ops.c
index 80eac39..2e6b25e 100644
--- a/drivers/mtd/spi/sf_ops.c
+++ b/drivers/mtd/spi/sf_ops.c
@@ -299,7 +299,8 @@ int spi_flash_write_common(struct spi_flash *flash, const u8 *cmd,
return ret;
}

-int spi_flash_cmd_erase_ops(struct spi_flash *flash, u32 offset, size_t len)
+static int spi_flash_cmd_erase_ops(struct spi_flash *flash, u32 offset,
+ size_t len)
{
u32 erase_size, erase_addr;
u8 cmd[SPI_FLASH_CMD_LEN];
@@ -350,7 +351,7 @@ int spi_flash_cmd_erase_ops(struct spi_flash *flash, u32 offset, size_t len)
return ret;
}

-int spi_flash_cmd_write_ops(struct spi_flash *flash, u32 offset,
+static int spi_flash_cmd_write_ops(struct spi_flash *flash, u32 offset,
size_t len, const void *buf)
{
unsigned long byte_addr, page_size;
@@ -435,7 +436,7 @@ void __weak spi_flash_copy_mmap(void *data, void *offset, size_t len)
memcpy(data, offset, len);
}

-int spi_flash_cmd_read_ops(struct spi_flash *flash, u32 offset,
+static int spi_flash_cmd_read_ops(struct spi_flash *flash, u32 offset,
size_t len, void *data)
{
u8 *cmd, cmdsz;
@@ -527,7 +528,7 @@ static int sst_byte_write(struct spi_flash *flash, u32 offset, const void *buf)
return spi_flash_cmd_wait_ready(flash, SPI_FLASH_PROG_TIMEOUT);
}

-int sst_write_wp(struct spi_flash *flash, u32 offset, size_t len,
+static int sst_write_wp(struct spi_flash *flash, u32 offset, size_t len,
const void *buf)
{
size_t actual, cmd_len;
@@ -594,7 +595,7 @@ int sst_write_wp(struct spi_flash *flash, u32 offset, size_t len,
return ret;
}

-int sst_write_bp(struct spi_flash *flash, u32 offset, size_t len,
+static int sst_write_bp(struct spi_flash *flash, u32 offset, size_t len,
const void *buf)
{
size_t actual;
--
1.9.1