Skip to content

Commit ac4f834

Browse files
brooniemiquelraynal
authored andcommitted
mtd: dataflash: Add SPI ID table
Currently autoloading for SPI devices does not use the DT ID table, it uses SPI modalises. Supporting OF modalises is going to be difficult if not impractical, an attempt was made but has been reverted, so ensure that module autoloading works for this driver by adding an id_table listing the SPI IDs for everything. Fixes: 96c8395 ("spi: Revert modalias changes") Signed-off-by: Mark Brown <broonie@kernel.org> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/linux-mtd/20220620152313.708768-1-broonie@kernel.org
1 parent c223a38 commit ac4f834

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
@@ -112,6 +112,13 @@ static const struct of_device_id dataflash_dt_ids[] = {
112112
MODULE_DEVICE_TABLE(of, dataflash_dt_ids);
113113
#endif
114114

115+
static const struct spi_device_id dataflash_spi_ids[] = {
116+
{ .name = "at45", },
117+
{ .name = "dataflash", },
118+
{ /* sentinel */ }
119+
};
120+
MODULE_DEVICE_TABLE(spi, dataflash_spi_ids);
121+
115122
/* ......................................................................... */
116123

117124
/*
@@ -936,6 +943,7 @@ static struct spi_driver dataflash_driver = {
936943

937944
.probe = dataflash_probe,
938945
.remove = dataflash_remove,
946+
.id_table = dataflash_spi_ids,
939947

940948
/* FIXME: investigate suspend and resume... */
941949
};

0 commit comments

Comments
 (0)