Skip to content

Commit 27a030e

Browse files
jonhuntermiquelraynal
authored andcommitted
mtd: dataflash: Add device-tree SPI IDs
Commit 5fa6863 ("spi: Check we have a spi_device_id for each DT compatible") added a test to check that every SPI driver has a spi_device_id for each DT compatiable string defined by the driver and warns if the spi_device_id is missing. The spi_device_ids are missing for the dataflash driver and the following warnings are now seen. WARNING KERN SPI driver mtd_dataflash has no spi_device_id for atmel,at45 WARNING KERN SPI driver mtd_dataflash has no spi_device_id for atmel,dataflash Fix this by adding the necessary spi_device_ids. Fixes: 96c8395 ("spi: Revert modalias changes") Signed-off-by: Jon Hunter <[email protected]> Signed-off-by: Miquel Raynal <[email protected]> Link: https://lore.kernel.org/linux-mtd/[email protected]
1 parent 9472335 commit 27a030e

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

drivers/mtd/devices/mtd_dataflash.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,13 @@ struct dataflash {
9696
struct mtd_info mtd;
9797
};
9898

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+
99106
#ifdef CONFIG_OF
100107
static const struct of_device_id dataflash_dt_ids[] = {
101108
{ .compatible = "atmel,at45", },
@@ -927,6 +934,7 @@ static struct spi_driver dataflash_driver = {
927934
.name = "mtd_dataflash",
928935
.of_match_table = of_match_ptr(dataflash_dt_ids),
929936
},
937+
.id_table = dataflash_dev_ids,
930938

931939
.probe = dataflash_probe,
932940
.remove = dataflash_remove,

0 commit comments

Comments
 (0)