Skip to content

Commit

Permalink
mtd: nand: omap2: Fix module autoload
Browse files Browse the repository at this point in the history
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@osg.samsung.com>
Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
  • Loading branch information
Javier Martinez Canillas authored and Boris Brezillon committed Oct 17, 2016
1 parent 1001354 commit b156b7f
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/mtd/nand/omap2.c
Original file line number Diff line number Diff line change
@@ -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,

0 comments on commit b156b7f

Please sign in to comment.