Skip to content

Commit 947bb8f

Browse files
mwalleambarus
authored andcommitted
mtd: spi-nor: issi: sort flash_info database
The flash ID is the new primary key into our database. Sort the entry by it. Keep the most specific ones first, because there might be ID collisions between shorter and longer ones. Signed-off-by: Michael Walle <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Tudor Ambarus <[email protected]>
1 parent 1d8e64f commit 947bb8f

File tree

1 file changed

+22
-22
lines changed

1 file changed

+22
-22
lines changed

drivers/mtd/spi-nor/issi.c

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -48,26 +48,43 @@ static const struct spi_nor_fixups pm25lv_nor_fixups = {
4848

4949
static const struct flash_info issi_nor_parts[] = {
5050
{
51+
.name = "pm25lv512",
52+
.sector_size = SZ_32K,
53+
.size = SZ_64K,
54+
.no_sfdp_flags = SECT_4K,
55+
.fixups = &pm25lv_nor_fixups
56+
}, {
57+
.name = "pm25lv010",
58+
.sector_size = SZ_32K,
59+
.size = SZ_128K,
60+
.no_sfdp_flags = SECT_4K,
61+
.fixups = &pm25lv_nor_fixups
62+
}, {
5163
.id = SNOR_ID(0x7f, 0x9d, 0x20),
5264
.name = "is25cd512",
5365
.sector_size = SZ_32K,
5466
.size = SZ_64K,
5567
.no_sfdp_flags = SECT_4K,
68+
}, {
69+
.id = SNOR_ID(0x7f, 0x9d, 0x46),
70+
.name = "pm25lq032",
71+
.size = SZ_4M,
72+
.no_sfdp_flags = SECT_4K,
5673
}, {
5774
.id = SNOR_ID(0x9d, 0x40, 0x13),
5875
.name = "is25lq040b",
5976
.size = SZ_512K,
6077
.no_sfdp_flags = SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ,
61-
}, {
62-
.id = SNOR_ID(0x9d, 0x60, 0x15),
63-
.name = "is25lp016d",
64-
.size = SZ_2M,
65-
.no_sfdp_flags = SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ,
6678
}, {
6779
.id = SNOR_ID(0x9d, 0x60, 0x14),
6880
.name = "is25lp080d",
6981
.size = SZ_1M,
7082
.no_sfdp_flags = SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ,
83+
}, {
84+
.id = SNOR_ID(0x9d, 0x60, 0x15),
85+
.name = "is25lp016d",
86+
.size = SZ_2M,
87+
.no_sfdp_flags = SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ,
7188
}, {
7289
.id = SNOR_ID(0x9d, 0x60, 0x16),
7390
.name = "is25lp032",
@@ -109,23 +126,6 @@ static const struct flash_info issi_nor_parts[] = {
109126
.flags = SPI_NOR_QUAD_PP,
110127
.fixups = &is25lp256_fixups,
111128
.fixup_flags = SPI_NOR_4B_OPCODES,
112-
}, {
113-
.name = "pm25lv512",
114-
.sector_size = SZ_32K,
115-
.size = SZ_64K,
116-
.no_sfdp_flags = SECT_4K,
117-
.fixups = &pm25lv_nor_fixups
118-
}, {
119-
.name = "pm25lv010",
120-
.sector_size = SZ_32K,
121-
.size = SZ_128K,
122-
.no_sfdp_flags = SECT_4K,
123-
.fixups = &pm25lv_nor_fixups
124-
}, {
125-
.id = SNOR_ID(0x7f, 0x9d, 0x46),
126-
.name = "pm25lq032",
127-
.size = SZ_4M,
128-
.no_sfdp_flags = SECT_4K,
129129
}
130130
};
131131

0 commit comments

Comments
 (0)