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

net: dsa: b53: 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/net/dsa/b53/b53_mmap.ko | grep alias
$

After this patch:

$ modinfo drivers/net/dsa/b53/b53_mmap.ko | grep alias
alias: of:N*T*Cbrcm,bcm63xx-switchC*
alias: of:N*T*Cbrcm,bcm63xx-switch
alias: of:N*T*Cbrcm,bcm6368-switchC*
alias: of:N*T*Cbrcm,bcm6368-switch
alias: of:N*T*Cbrcm,bcm6328-switchC*
alias: of:N*T*Cbrcm,bcm6328-switch
alias: of:N*T*Cbrcm,bcm3384-switchC*
alias: of:N*T*Cbrcm,bcm3384-switch

Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Javier Martinez Canillas and committed by
David S. Miller
03eaae52 af40097e

+1
+1
drivers/net/dsa/b53/b53_mmap.c
··· 256 256 { .compatible = "brcm,bcm63xx-switch" }, 257 257 { /* sentinel */ }, 258 258 }; 259 + MODULE_DEVICE_TABLE(of, b53_mmap_of_table); 259 260 260 261 static struct platform_driver b53_mmap_driver = { 261 262 .probe = b53_mmap_probe,