]> git.karo-electronics.de Git - linux-beck.git/commitdiff
spi: xlp: Fix module autoload for OF registration
authorJavier Martinez Canillas <javier@osg.samsung.com>
Wed, 23 Nov 2016 16:37:10 +0000 (13:37 -0300)
committerMark Brown <broonie@kernel.org>
Wed, 23 Nov 2016 16:42:32 +0000 (16:42 +0000)
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-xlp.ko | grep alias
alias:          acpi*:BRCM900D:*

After this patch:

$ modinfo drivers/spi/spi-xlp.ko | grep alias
alias:          acpi*:BRCM900D:*
alias:          of:N*T*Cnetlogic,xlp832-spiC*
alias:          of:N*T*Cnetlogic,xlp832-spi

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

index 4071a729eb2f2af5ffd8f81c9113c026a07d3e34..bea7a93a60468813d904f3d9457c8e8440055ec3 100644 (file)
@@ -451,6 +451,7 @@ static const struct of_device_id xlp_spi_dt_id[] = {
        { .compatible = "netlogic,xlp832-spi" },
        { },
 };
+MODULE_DEVICE_TABLE(of, xlp_spi_dt_id);
 
 static struct platform_driver xlp_spi_driver = {
        .probe  = xlp_spi_probe,