Skip to content

Commit eda7d46

Browse files
ryderlee1110davem330
authored andcommitted
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 <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 5d13659 commit eda7d46

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

drivers/net/ethernet/mediatek/mtk_eth_soc.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2503,7 +2503,6 @@ static int mtk_probe(struct platform_device *pdev)
25032503
{
25042504
struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
25052505
struct device_node *mac_np;
2506-
const struct of_device_id *match;
25072506
struct mtk_eth *eth;
25082507
int err;
25092508
int i;
@@ -2512,8 +2511,7 @@ static int mtk_probe(struct platform_device *pdev)
25122511
if (!eth)
25132512
return -ENOMEM;
25142513

2515-
match = of_match_device(of_mtk_match, &pdev->dev);
2516-
eth->soc = (struct mtk_soc_data *)match->data;
2514+
eth->soc = of_device_get_match_data(&pdev->dev);
25172515

25182516
eth->dev = &pdev->dev;
25192517
eth->base = devm_ioremap_resource(&pdev->dev, res);

0 commit comments

Comments
 (0)