Thread (5 messages) 5 messages, 2 authors, 2017-08-18
STALE3228d

[PATCH 4/4] phy: tegra: use of_device_get_match_data()

From: chunfeng.yun@mediatek.com (Chunfeng Yun)
Date: 2017-08-09 09:18:19
Also in: linux-mediatek, linux-rockchip, linux-samsung-soc, linux-tegra, lkml
Subsystem: generic phy framework, tegra xusb padctl driver, the rest · Maintainers: Vinod Koul, JC Kuo, Linus Torvalds

reduce the boilerplate code to get the specific data

Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
---
 drivers/phy/tegra/xusb.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/phy/tegra/xusb.c b/drivers/phy/tegra/xusb.c
index 3cbcb25..25cdfb1 100644
--- a/drivers/phy/tegra/xusb.c
+++ b/drivers/phy/tegra/xusb.c
@@ -848,7 +848,6 @@ static int tegra_xusb_padctl_probe(struct platform_device *pdev)
 	struct device_node *np = of_node_get(pdev->dev.of_node);
 	const struct tegra_xusb_padctl_soc *soc;
 	struct tegra_xusb_padctl *padctl;
-	const struct of_device_id *match;
 	struct resource *res;
 	int err;
 
@@ -861,8 +860,9 @@ static int tegra_xusb_padctl_probe(struct platform_device *pdev)
 
 	of_node_put(np);
 
-	match = of_match_node(tegra_xusb_padctl_of_match, pdev->dev.of_node);
-	soc = match->data;
+	soc = of_device_get_match_data(&pdev->dev);
+	if (!soc)
+		return -EINVAL;
 
 	padctl = soc->ops->probe(&pdev->dev, soc);
 	if (IS_ERR(padctl))
-- 
1.7.9.5
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help