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

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: 96c8395e2166 ("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

authored by

Mark Brown and committed by
Miquel Raynal
ac4f8348 c223a38d

+8
+8
drivers/mtd/devices/mtd_dataflash.c
··· 112 112 MODULE_DEVICE_TABLE(of, dataflash_dt_ids); 113 113 #endif 114 114 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 + 115 122 /* ......................................................................... */ 116 123 117 124 /* ··· 943 936 944 937 .probe = dataflash_probe, 945 938 .remove = dataflash_remove, 939 + .id_table = dataflash_spi_ids, 946 940 947 941 /* FIXME: investigate suspend and resume... */ 948 942 };