mtd: nand: omap2: Fix module autoload

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Fri Dec 16 11:59:02 PST 2016


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=b156b7f2169bb4d963a2432ff03319fe7d64b823
Commit:     b156b7f2169bb4d963a2432ff03319fe7d64b823
Parent:     1001354ca34179f3db924eb66672442a173147dc
Author:     Javier Martinez Canillas <javier at osg.samsung.com>
AuthorDate: Mon Oct 17 13:19:37 2016 -0300
Committer:  Boris Brezillon <boris.brezillon at free-electrons.com>
CommitDate: Mon Oct 17 19:06:47 2016 +0200

    mtd: nand: omap2: Fix module autoload
    
    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/mtd/nand/omap2_nand.ko | grep alias
    alias:          platform:omap2-nand
    
    After this patch:
    
    $ modinfo drivers/mtd/nand/omap2_nand.ko | grep alias
    alias:          platform:omap2-nand
    alias:          of:N*T*Cti,omap2-nandC*
    alias:          of:N*T*Cti,omap2-nand
    
    Signed-off-by: Javier Martinez Canillas <javier at osg.samsung.com>
    Signed-off-by: Boris Brezillon <boris.brezillon at free-electrons.com>
---
 drivers/mtd/nand/omap2.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/mtd/nand/omap2.c b/drivers/mtd/nand/omap2.c
index 5513bfd9..0934c3b 100644
--- a/drivers/mtd/nand/omap2.c
+++ b/drivers/mtd/nand/omap2.c
@@ -2197,6 +2197,7 @@ static const struct of_device_id omap_nand_ids[] = {
 	{ .compatible = "ti,omap2-nand", },
 	{},
 };
+MODULE_DEVICE_TABLE(of, omap_nand_ids);
 
 static struct platform_driver omap_nand_driver = {
 	.probe		= omap_nand_probe,



More information about the linux-mtd-cvs mailing list