net: dsa: mt7530: fix module autoloading for OF platform drivers
authorSean Wang <sean.wang@mediatek.com>
Mon, 26 Mar 2018 10:07:10 +0000 (18:07 +0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 26 Mar 2018 17:09:42 +0000 (13:09 -0400)
It's required to create a modules.alias via MODULE_DEVICE_TABLE helper
for the OF platform driver. Otherwise, module autoloading cannot work.

Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/dsa/mt7530.c

index d31246cbefd1b72edc3cffb91db3372f3b62139c..4e53c5ce23ffe484fbccdfc75db1b5bb5382185d 100644 (file)
@@ -1409,6 +1409,7 @@ static const struct of_device_id mt7530_of_match[] = {
        { .compatible = "mediatek,mt7530" },
        { /* sentinel */ },
 };
+MODULE_DEVICE_TABLE(of, mt7530_of_match);
 
 static struct mdio_driver mt7530_mdio_driver = {
        .probe  = mt7530_probe,