1 From 3e53007a55e70d5036a527900befecf9a6316d05 Mon Sep 17 00:00:00 2001
2 From: Chunfeng Yun <chunfeng.yun@mediatek.com>
3 Date: Thu, 28 Dec 2017 16:40:36 +0530
4 Subject: [PATCH 179/224] phy: phy-mtk-tphy: use of_device_get_match_data()
6 reduce the boilerplate code to get the specific data
8 Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
9 Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
11 drivers/phy/mediatek/phy-mtk-tphy.c | 11 +++++------
12 1 file changed, 5 insertions(+), 6 deletions(-)
14 --- a/drivers/phy/mediatek/phy-mtk-tphy.c
15 +++ b/drivers/phy/mediatek/phy-mtk-tphy.c
17 #include <linux/iopoll.h>
18 #include <linux/module.h>
19 #include <linux/of_address.h>
20 +#include <linux/of_device.h>
21 #include <linux/phy/phy.h>
22 #include <linux/platform_device.h>
24 @@ -995,7 +996,6 @@ MODULE_DEVICE_TABLE(of, mtk_tphy_id_tabl
26 static int mtk_tphy_probe(struct platform_device *pdev)
28 - const struct of_device_id *match;
29 struct device *dev = &pdev->dev;
30 struct device_node *np = dev->of_node;
31 struct device_node *child_np;
32 @@ -1005,15 +1005,14 @@ static int mtk_tphy_probe(struct platfor
36 - match = of_match_node(mtk_tphy_id_table, pdev->dev.of_node);
40 tphy = devm_kzalloc(dev, sizeof(*tphy), GFP_KERNEL);
44 - tphy->pdata = match->data;
45 + tphy->pdata = of_device_get_match_data(dev);
49 tphy->nphys = of_get_child_count(np);
50 tphy->phys = devm_kcalloc(dev, tphy->nphys,
51 sizeof(*tphy->phys), GFP_KERNEL);