Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mtd: dataflash: remove duplicate SPI ID table

Building with -Werror=override-init reveals that two patches added
the same device ID table to this driver:

drivers/mtd/devices/mtd_dataflash.c:946:27: error: initialized field overwritten [-Werror=override-init]
946 | .id_table = dataflash_spi_ids,
| ^~~~~~~~~~~~~~~~~
drivers/mtd/devices/mtd_dataflash.c:946:27: note: (near initialization for 'dataflash_driver.id_table')

Remove one of the copies.

Fixes: 27a030e87292 ("mtd: dataflash: Add device-tree SPI IDs")
Fixes: ac4f83482afb ("mtd: dataflash: Add SPI ID table")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20221215164736.1315815-1-arnd@kernel.org

authored by

Arnd Bergmann and committed by
Miquel Raynal
a30144c0 1b929c02

-9
-9
drivers/mtd/devices/mtd_dataflash.c
··· 96 96 struct mtd_info mtd; 97 97 }; 98 98 99 - static const struct spi_device_id dataflash_dev_ids[] = { 100 - { "at45" }, 101 - { "dataflash" }, 102 - { }, 103 - }; 104 - MODULE_DEVICE_TABLE(spi, dataflash_dev_ids); 105 - 106 99 #ifdef CONFIG_OF 107 100 static const struct of_device_id dataflash_dt_ids[] = { 108 101 { .compatible = "atmel,at45", }, ··· 932 939 .name = "mtd_dataflash", 933 940 .of_match_table = of_match_ptr(dataflash_dt_ids), 934 941 }, 935 - .id_table = dataflash_dev_ids, 936 - 937 942 .probe = dataflash_probe, 938 943 .remove = dataflash_remove, 939 944 .id_table = dataflash_spi_ids,