lkml.org 
[lkml]   [2016]   [Nov]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 1/4] spi: spi-axi: Fix module autoload
Date
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-axi-spi-engine.ko | grep alias
$

After this patch:

$ modinfo drivers/spi/spi-axi-spi-engine.ko | grep alias
alias: of:N*T*Cadi,axi-spi-engine-1.00.aC*
alias: of:N*T*Cadi,axi-spi-engine-1.00.a

Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
---

drivers/spi/spi-axi-spi-engine.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/spi/spi-axi-spi-engine.c b/drivers/spi/spi-axi-spi-engine.c
index 2b1456e5e221..319225d7e761 100644
--- a/drivers/spi/spi-axi-spi-engine.c
+++ b/drivers/spi/spi-axi-spi-engine.c
@@ -574,6 +574,7 @@ static const struct of_device_id spi_engine_match_table[] = {
{ .compatible = "adi,axi-spi-engine-1.00.a" },
{ },
};
+MODULE_DEVICE_TABLE(of, spi_engine_match_table);

static struct platform_driver spi_engine_driver = {
.probe = spi_engine_probe,
--
2.7.4
\
 
 \ /
  Last update: 2016-11-23 17:38    [W:0.112 / U:0.412 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site