Skip to content

Commit bc7ee2e

Browse files
brooniemiquelraynal
authored andcommitted
mtd: mchp23k256: 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> Reviewed-by: Michael Walle <michael@walle.cc> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/linux-mtd/20220202143404.16070-3-broonie@kernel.org
1 parent e02dacd commit bc7ee2e

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

drivers/mtd/devices/mchp23k256.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,13 +231,27 @@ static const struct of_device_id mchp23k256_of_table[] = {
231231
};
232232
MODULE_DEVICE_TABLE(of, mchp23k256_of_table);
233233

234+
static const struct spi_device_id mchp23k256_spi_ids[] = {
235+
{
236+
.name = "mchp23k256",
237+
.driver_data = (kernel_ulong_t)&mchp23k256_caps,
238+
},
239+
{
240+
.name = "mchp23lcv1024",
241+
.driver_data = (kernel_ulong_t)&mchp23lcv1024_caps,
242+
},
243+
{}
244+
};
245+
MODULE_DEVICE_TABLE(spi, mchp23k256_spi_ids);
246+
234247
static struct spi_driver mchp23k256_driver = {
235248
.driver = {
236249
.name = "mchp23k256",
237250
.of_match_table = mchp23k256_of_table,
238251
},
239252
.probe = mchp23k256_probe,
240253
.remove = mchp23k256_remove,
254+
.id_table = mchp23k256_spi_ids,
241255
};
242256

243257
module_spi_driver(mchp23k256_driver);

0 commit comments

Comments
 (0)