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

spi: ath79: Fix module autoload for OF registration

If the driver is built as a module, autoload won't work because the module
alias information is not filled. So user-space can't match the registered
device with the corresponding module.

Export the module alias information using the MODULE_DEVICE_TABLE() macro.

Before this patch:

$ modinfo drivers/spi/spi-ath79.ko | grep alias
alias: platform:ath79-spi

After this patch:

$ modinfo drivers/spi/spi-ath79.ko | grep alias
alias: platform:ath79-spi
alias: of:N*T*Cqca,ar7100-spiC*
alias: of:N*T*Cqca,ar7100-spi

Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Javier Martinez Canillas and committed by
Mark Brown
d7a32394 1001354c

+1
+1
drivers/spi/spi-ath79.c
··· 304 304 { .compatible = "qca,ar7100-spi", }, 305 305 { }, 306 306 }; 307 + MODULE_DEVICE_TABLE(of, ath79_spi_of_match); 307 308 308 309 static struct platform_driver ath79_spi_driver = { 309 310 .probe = ath79_spi_probe,