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

rtc: mcp795: 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: Alexandre Belloni <alexandre.belloni@bootlin.com>
Link: https://lore.kernel.org/r/20210927130240.33693-1-broonie@kernel.org

authored by

Mark Brown and committed by
Alexandre Belloni
3109151c 27ff63eb

+7
+7
drivers/rtc/rtc-mcp795.c
··· 430 430 MODULE_DEVICE_TABLE(of, mcp795_of_match); 431 431 #endif 432 432 433 + static const struct spi_device_id mcp795_spi_ids[] = { 434 + { .name = "mcp795" }, 435 + { } 436 + }; 437 + MODULE_DEVICE_TABLE(spi, mcp795_spi_ids); 438 + 433 439 static struct spi_driver mcp795_driver = { 434 440 .driver = { 435 441 .name = "rtc-mcp795", 436 442 .of_match_table = of_match_ptr(mcp795_of_match), 437 443 }, 438 444 .probe = mcp795_probe, 445 + .id_table = mcp795_spi_ids, 439 446 }; 440 447 441 448 module_spi_driver(mcp795_driver);