Skip to content

Commit 74883ac

Browse files
BoughChenprati0100
authored andcommitted
mtd: spi-nor: micron-st: rename the die_late_init functions
st_nor_two/four_die_late_init() also suit for micron chips, so rename to micron_st_nor_two/four_die_late_init(), and move these functions up, then micron can use these function without declaration. Reviewed-by: Tudor Ambarus <tudor.ambarus@linaro.org> Signed-off-by: Haibo Chen <haibo.chen@nxp.com> Signed-off-by: Pratyush Yadav <pratyush@kernel.org>
1 parent e8f288a commit 74883ac

1 file changed

Lines changed: 35 additions & 35 deletions

File tree

drivers/mtd/spi-nor/micron-st.c

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,38 @@ static int micron_st_nor_set_octal_dtr(struct spi_nor *nor, bool enable)
127127
micron_st_nor_octal_dtr_dis(nor);
128128
}
129129

130+
static int micron_st_nor_four_die_late_init(struct spi_nor *nor)
131+
{
132+
struct spi_nor_flash_parameter *params = nor->params;
133+
134+
params->die_erase_opcode = SPINOR_OP_MT_DIE_ERASE;
135+
params->n_dice = 4;
136+
137+
/*
138+
* Unfortunately the die erase opcode does not have a 4-byte opcode
139+
* correspondent for these flashes. The SFDP 4BAIT table fails to
140+
* consider the die erase too. We're forced to enter in the 4 byte
141+
* address mode in order to benefit of the die erase.
142+
*/
143+
return spi_nor_set_4byte_addr_mode(nor, true);
144+
}
145+
146+
static int micron_st_nor_two_die_late_init(struct spi_nor *nor)
147+
{
148+
struct spi_nor_flash_parameter *params = nor->params;
149+
150+
params->die_erase_opcode = SPINOR_OP_MT_DIE_ERASE;
151+
params->n_dice = 2;
152+
153+
/*
154+
* Unfortunately the die erase opcode does not have a 4-byte opcode
155+
* correspondent for these flashes. The SFDP 4BAIT table fails to
156+
* consider the die erase too. We're forced to enter in the 4 byte
157+
* address mode in order to benefit of the die erase.
158+
*/
159+
return spi_nor_set_4byte_addr_mode(nor, true);
160+
}
161+
130162
static void mt35xu512aba_default_init(struct spi_nor *nor)
131163
{
132164
nor->params->set_octal_dtr = micron_st_nor_set_octal_dtr;
@@ -193,48 +225,16 @@ static const struct spi_nor_fixups mt25qu512a_fixups = {
193225
.post_bfpt = mt25qu512a_post_bfpt_fixup,
194226
};
195227

196-
static int st_nor_four_die_late_init(struct spi_nor *nor)
197-
{
198-
struct spi_nor_flash_parameter *params = nor->params;
199-
200-
params->die_erase_opcode = SPINOR_OP_MT_DIE_ERASE;
201-
params->n_dice = 4;
202-
203-
/*
204-
* Unfortunately the die erase opcode does not have a 4-byte opcode
205-
* correspondent for these flashes. The SFDP 4BAIT table fails to
206-
* consider the die erase too. We're forced to enter in the 4 byte
207-
* address mode in order to benefit of the die erase.
208-
*/
209-
return spi_nor_set_4byte_addr_mode(nor, true);
210-
}
211-
212-
static int st_nor_two_die_late_init(struct spi_nor *nor)
213-
{
214-
struct spi_nor_flash_parameter *params = nor->params;
215-
216-
params->die_erase_opcode = SPINOR_OP_MT_DIE_ERASE;
217-
params->n_dice = 2;
218-
219-
/*
220-
* Unfortunately the die erase opcode does not have a 4-byte opcode
221-
* correspondent for these flashes. The SFDP 4BAIT table fails to
222-
* consider the die erase too. We're forced to enter in the 4 byte
223-
* address mode in order to benefit of the die erase.
224-
*/
225-
return spi_nor_set_4byte_addr_mode(nor, true);
226-
}
227-
228228
static const struct spi_nor_fixups n25q00_fixups = {
229-
.late_init = st_nor_four_die_late_init,
229+
.late_init = micron_st_nor_four_die_late_init,
230230
};
231231

232232
static const struct spi_nor_fixups mt25q01_fixups = {
233-
.late_init = st_nor_two_die_late_init,
233+
.late_init = micron_st_nor_two_die_late_init,
234234
};
235235

236236
static const struct spi_nor_fixups mt25q02_fixups = {
237-
.late_init = st_nor_four_die_late_init,
237+
.late_init = micron_st_nor_four_die_late_init,
238238
};
239239

240240
static const struct flash_info st_nor_parts[] = {

0 commit comments

Comments
 (0)