提交 87f3ed18 编写于 作者: B Boris Brezillon

mtd: spi-nor: Drop inline on all internal helpers

gcc should be smart enough to decide when inlining a function makes
sense. Drop all inline specifiers.
Signed-off-by: NBoris Brezillon <boris.brezillon@bootlin.com>
Reviewed-by: NTudor Ambarus <tudor.ambarus@microchip.com>
上级 2bffa65d
...@@ -352,7 +352,7 @@ static int read_cr(struct spi_nor *nor) ...@@ -352,7 +352,7 @@ static int read_cr(struct spi_nor *nor)
* Write status register 1 byte * Write status register 1 byte
* Returns negative if error occurred. * Returns negative if error occurred.
*/ */
static inline int write_sr(struct spi_nor *nor, u8 val) static int write_sr(struct spi_nor *nor, u8 val)
{ {
nor->cmd_buf[0] = val; nor->cmd_buf[0] = val;
return nor->write_reg(nor, SPINOR_OP_WRSR, nor->cmd_buf, 1); return nor->write_reg(nor, SPINOR_OP_WRSR, nor->cmd_buf, 1);
...@@ -362,7 +362,7 @@ static inline int write_sr(struct spi_nor *nor, u8 val) ...@@ -362,7 +362,7 @@ static inline int write_sr(struct spi_nor *nor, u8 val)
* Set write enable latch with Write Enable command. * Set write enable latch with Write Enable command.
* Returns negative if error occurred. * Returns negative if error occurred.
*/ */
static inline int write_enable(struct spi_nor *nor) static int write_enable(struct spi_nor *nor)
{ {
return nor->write_reg(nor, SPINOR_OP_WREN, NULL, 0); return nor->write_reg(nor, SPINOR_OP_WREN, NULL, 0);
} }
...@@ -370,12 +370,12 @@ static inline int write_enable(struct spi_nor *nor) ...@@ -370,12 +370,12 @@ static inline int write_enable(struct spi_nor *nor)
/* /*
* Send write disable instruction to the chip. * Send write disable instruction to the chip.
*/ */
static inline int write_disable(struct spi_nor *nor) static int write_disable(struct spi_nor *nor)
{ {
return nor->write_reg(nor, SPINOR_OP_WRDI, NULL, 0); return nor->write_reg(nor, SPINOR_OP_WRDI, NULL, 0);
} }
static inline struct spi_nor *mtd_to_spi_nor(struct mtd_info *mtd) static struct spi_nor *mtd_to_spi_nor(struct mtd_info *mtd)
{ {
return mtd->priv; return mtd->priv;
} }
...@@ -393,7 +393,7 @@ static u8 spi_nor_convert_opcode(u8 opcode, const u8 table[][2], size_t size) ...@@ -393,7 +393,7 @@ static u8 spi_nor_convert_opcode(u8 opcode, const u8 table[][2], size_t size)
return opcode; return opcode;
} }
static inline u8 spi_nor_convert_3to4_read(u8 opcode) static u8 spi_nor_convert_3to4_read(u8 opcode)
{ {
static const u8 spi_nor_3to4_read[][2] = { static const u8 spi_nor_3to4_read[][2] = {
{ SPINOR_OP_READ, SPINOR_OP_READ_4B }, { SPINOR_OP_READ, SPINOR_OP_READ_4B },
...@@ -412,7 +412,7 @@ static inline u8 spi_nor_convert_3to4_read(u8 opcode) ...@@ -412,7 +412,7 @@ static inline u8 spi_nor_convert_3to4_read(u8 opcode)
ARRAY_SIZE(spi_nor_3to4_read)); ARRAY_SIZE(spi_nor_3to4_read));
} }
static inline u8 spi_nor_convert_3to4_program(u8 opcode) static u8 spi_nor_convert_3to4_program(u8 opcode)
{ {
static const u8 spi_nor_3to4_program[][2] = { static const u8 spi_nor_3to4_program[][2] = {
{ SPINOR_OP_PP, SPINOR_OP_PP_4B }, { SPINOR_OP_PP, SPINOR_OP_PP_4B },
...@@ -424,7 +424,7 @@ static inline u8 spi_nor_convert_3to4_program(u8 opcode) ...@@ -424,7 +424,7 @@ static inline u8 spi_nor_convert_3to4_program(u8 opcode)
ARRAY_SIZE(spi_nor_3to4_program)); ARRAY_SIZE(spi_nor_3to4_program));
} }
static inline u8 spi_nor_convert_3to4_erase(u8 opcode) static u8 spi_nor_convert_3to4_erase(u8 opcode)
{ {
static const u8 spi_nor_3to4_erase[][2] = { static const u8 spi_nor_3to4_erase[][2] = {
{ SPINOR_OP_BE_4K, SPINOR_OP_BE_4K_4B }, { SPINOR_OP_BE_4K, SPINOR_OP_BE_4K_4B },
...@@ -469,8 +469,8 @@ static void spi_nor_set_4byte_opcodes(struct spi_nor *nor, ...@@ -469,8 +469,8 @@ static void spi_nor_set_4byte_opcodes(struct spi_nor *nor,
} }
/* Enable/disable 4-byte addressing mode. */ /* Enable/disable 4-byte addressing mode. */
static inline int set_4byte(struct spi_nor *nor, const struct flash_info *info, static int set_4byte(struct spi_nor *nor, const struct flash_info *info,
int enable) int enable)
{ {
int status; int status;
bool need_wren = false; bool need_wren = false;
...@@ -528,7 +528,7 @@ static int s3an_sr_ready(struct spi_nor *nor) ...@@ -528,7 +528,7 @@ static int s3an_sr_ready(struct spi_nor *nor)
return !!(val & XSR_RDY); return !!(val & XSR_RDY);
} }
static inline int spi_nor_sr_ready(struct spi_nor *nor) static int spi_nor_sr_ready(struct spi_nor *nor)
{ {
int sr = read_sr(nor); int sr = read_sr(nor);
if (sr < 0) if (sr < 0)
...@@ -547,7 +547,7 @@ static inline int spi_nor_sr_ready(struct spi_nor *nor) ...@@ -547,7 +547,7 @@ static inline int spi_nor_sr_ready(struct spi_nor *nor)
return !(sr & SR_WIP); return !(sr & SR_WIP);
} }
static inline int spi_nor_fsr_ready(struct spi_nor *nor) static int spi_nor_fsr_ready(struct spi_nor *nor)
{ {
int fsr = read_fsr(nor); int fsr = read_fsr(nor);
if (fsr < 0) if (fsr < 0)
...@@ -2420,7 +2420,7 @@ static int spi_nor_read_sfdp_dma_unsafe(struct spi_nor *nor, u32 addr, ...@@ -2420,7 +2420,7 @@ static int spi_nor_read_sfdp_dma_unsafe(struct spi_nor *nor, u32 addr,
/* Fast Read settings. */ /* Fast Read settings. */
static inline void static void
spi_nor_set_read_settings_from_bfpt(struct spi_nor_read_command *read, spi_nor_set_read_settings_from_bfpt(struct spi_nor_read_command *read,
u16 half, u16 half,
enum spi_nor_protocol proto) enum spi_nor_protocol proto)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册