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

rtc: pcf2123: 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/20210923194922.53386-4-broonie@kernel.org

authored by

Mark Brown and committed by
Alexandre Belloni
5f84478e da87639d

+9
+9
drivers/rtc/rtc-pcf2123.c
··· 451 451 MODULE_DEVICE_TABLE(of, pcf2123_dt_ids); 452 452 #endif 453 453 454 + static const struct spi_device_id pcf2123_spi_ids[] = { 455 + { .name = "pcf2123", }, 456 + { .name = "rv2123", }, 457 + { .name = "rtc-pcf2123", }, 458 + { /* sentinel */ } 459 + }; 460 + MODULE_DEVICE_TABLE(spi, pcf2123_spi_ids); 461 + 454 462 static struct spi_driver pcf2123_driver = { 455 463 .driver = { 456 464 .name = "rtc-pcf2123", 457 465 .of_match_table = of_match_ptr(pcf2123_dt_ids), 458 466 }, 459 467 .probe = pcf2123_probe, 468 + .id_table = pcf2123_spi_ids, 460 469 }; 461 470 462 471 module_spi_driver(pcf2123_driver);