Skip to content

Commit bc16dfc

Browse files
mwalleambarus
authored andcommitted
mtd: spi-nor: eon: 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 <mwalle@kernel.org> Link: https://lore.kernel.org/r/20230807-mtd-flash-info-db-rework-v3-32-e60548861b10@kernel.org Signed-off-by: Tudor Ambarus <tudor.ambarus@linaro.org>
1 parent a16ae25 commit bc16dfc

1 file changed

Lines changed: 18 additions & 18 deletions

File tree

drivers/mtd/spi-nor/eon.c

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -10,32 +10,37 @@
1010

1111
static const struct flash_info eon_nor_parts[] = {
1212
{
13-
.id = SNOR_ID(0x1c, 0x31, 0x16),
14-
.name = "en25f32",
15-
.size = SZ_4M,
16-
.no_sfdp_flags = SECT_4K,
17-
}, {
1813
.id = SNOR_ID(0x1c, 0x20, 0x16),
1914
.name = "en25p32",
2015
.size = SZ_4M,
21-
}, {
22-
.id = SNOR_ID(0x1c, 0x30, 0x16),
23-
.name = "en25q32b",
24-
.size = SZ_4M,
2516
}, {
2617
.id = SNOR_ID(0x1c, 0x20, 0x17),
2718
.name = "en25p64",
2819
.size = SZ_8M,
20+
}, {
21+
.id = SNOR_ID(0x1c, 0x30, 0x14),
22+
.name = "en25q80a",
23+
.size = SZ_1M,
24+
.no_sfdp_flags = SECT_4K | SPI_NOR_DUAL_READ,
25+
}, {
26+
.id = SNOR_ID(0x1c, 0x30, 0x16),
27+
.name = "en25q32b",
28+
.size = SZ_4M,
2929
}, {
3030
.id = SNOR_ID(0x1c, 0x30, 0x17),
3131
.name = "en25q64",
3232
.size = SZ_8M,
3333
.no_sfdp_flags = SECT_4K,
3434
}, {
35-
.id = SNOR_ID(0x1c, 0x30, 0x14),
36-
.name = "en25q80a",
37-
.size = SZ_1M,
38-
.no_sfdp_flags = SECT_4K | SPI_NOR_DUAL_READ,
35+
.id = SNOR_ID(0x1c, 0x31, 0x16),
36+
.name = "en25f32",
37+
.size = SZ_4M,
38+
.no_sfdp_flags = SECT_4K,
39+
}, {
40+
.name = "en25s64",
41+
.id = SNOR_ID(0x1c, 0x38, 0x17),
42+
.size = SZ_8M,
43+
.no_sfdp_flags = SECT_4K,
3944
}, {
4045
.id = SNOR_ID(0x1c, 0x70, 0x15),
4146
.name = "en25qh16",
@@ -57,11 +62,6 @@ static const struct flash_info eon_nor_parts[] = {
5762
}, {
5863
.id = SNOR_ID(0x1c, 0x70, 0x19),
5964
.name = "en25qh256",
60-
}, {
61-
.name = "en25s64",
62-
.id = SNOR_ID(0x1c, 0x38, 0x17),
63-
.size = SZ_8M,
64-
.no_sfdp_flags = SECT_4K,
6565
},
6666
};
6767

0 commit comments

Comments
 (0)