]> git.baikalelectronics.ru Git - kernel.git/commitdiff
net: ethernet: mediatek: remove useless code in mtk_probe()
authorGustavo A. R. Silva <garsilva@embeddedor.com>
Fri, 7 Jul 2017 20:23:34 +0000 (15:23 -0500)
committerDavid S. Miller <davem@davemloft.net>
Sat, 8 Jul 2017 10:27:55 +0000 (11:27 +0100)
Remove useless local variables _match_, _soc_ and the code related.

Notice that

const struct of_device_id of_mtk_match[] = {
        { .compatible = "mediatek,mt2701-eth" },
        {},
};

So match->data is NULL.

Suggested-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mediatek/mtk_eth_soc.c

index 41a5c5d2ac892fe4cf253a5d40ace003ccdab7a3..b3d0c2e6347a636aa23a6f637233d27d7b55f646 100644 (file)
@@ -2401,15 +2401,10 @@ 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_soc_data *soc;
        struct mtk_eth *eth;
        int err;
        int i;
 
-       match = of_match_device(of_mtk_match, &pdev->dev);
-       soc = (struct mtk_soc_data *)match->data;
-
        eth = devm_kzalloc(&pdev->dev, sizeof(*eth), GFP_KERNEL);
        if (!eth)
                return -ENOMEM;