summaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorRyder Lee <ryder.lee@mediatek.com>2018-04-16 10:33:41 +0800
committerDavid S. Miller <davem@davemloft.net>2018-04-16 13:43:07 -0400
commiteda7d46da443e154cbc8f7c1d68acc5088d38181 (patch)
tree98b838c100a21f4b35e9c18df1634a67b9418f2d /drivers/net
parent5d1365940a68dd57b031b6e3c07d7d451cd69daf (diff)
downloadlinux-eda7d46da443e154cbc8f7c1d68acc5088d38181.tar.gz
linux-eda7d46da443e154cbc8f7c1d68acc5088d38181.tar.bz2
linux-eda7d46da443e154cbc8f7c1d68acc5088d38181.zip
net: mediatek: use of_device_get_match_data()
The usage of of_device_get_match_data() reduce the code size a bit. Also, the only way to call mtk_probe() is to match an entry in of_mtk_match[], so match cannot be NULL. Signed-off-by: Ryder Lee <ryder.lee@mediatek.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/ethernet/mediatek/mtk_eth_soc.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
index e0b72bf428f7..d8ebf0a05e0c 100644
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -2503,7 +2503,6 @@ static int mtk_probe(struct platform_device *pdev)
{
struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
struct device_node *mac_np;
- const struct of_device_id *match;
struct mtk_eth *eth;
int err;
int i;
@@ -2512,8 +2511,7 @@ static int mtk_probe(struct platform_device *pdev)
if (!eth)
return -ENOMEM;
- match = of_match_device(of_mtk_match, &pdev->dev);
- eth->soc = (struct mtk_soc_data *)match->data;
+ eth->soc = of_device_get_match_data(&pdev->dev);
eth->dev = &pdev->dev;
eth->base = devm_ioremap_resource(&pdev->dev, res);