[PATCH v3 phy 10/17] phy: lynx-28g: use "dev" argument more in lynx_28g_probe()

Vladimir Oltean posted 17 patches 5 days, 4 hours ago
[PATCH v3 phy 10/17] phy: lynx-28g: use "dev" argument more in lynx_28g_probe()
Posted by Vladimir Oltean 5 days, 4 hours ago
We have "dev" which holds &pdev->dev, but we still dereference this
pointer 5 more times, instead of using the local variable.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
---
v2->v3: none
v1->v2: patch is new

 drivers/phy/freescale/phy-fsl-lynx-28g.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/phy/freescale/phy-fsl-lynx-28g.c b/drivers/phy/freescale/phy-fsl-lynx-28g.c
index eb2353531ef7..7800f57413ee 100644
--- a/drivers/phy/freescale/phy-fsl-lynx-28g.c
+++ b/drivers/phy/freescale/phy-fsl-lynx-28g.c
@@ -1133,10 +1133,10 @@ static int lynx_28g_probe(struct platform_device *pdev)
 	struct lynx_28g_priv *priv;
 	int i;
 
-	priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL);
+	priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
 	if (!priv)
 		return -ENOMEM;
-	priv->dev = &pdev->dev;
+	priv->dev = dev;
 
 	priv->base = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(priv->base))
@@ -1150,7 +1150,7 @@ static int lynx_28g_probe(struct platform_device *pdev)
 
 		memset(lane, 0, sizeof(*lane));
 
-		phy = devm_phy_create(&pdev->dev, NULL, &lynx_28g_ops);
+		phy = devm_phy_create(dev, NULL, &lynx_28g_ops);
 		if (IS_ERR(phy))
 			return PTR_ERR(phy);
 
@@ -1169,8 +1169,8 @@ static int lynx_28g_probe(struct platform_device *pdev)
 	queue_delayed_work(system_power_efficient_wq, &priv->cdr_check,
 			   msecs_to_jiffies(1000));
 
-	dev_set_drvdata(&pdev->dev, priv);
-	provider = devm_of_phy_provider_register(&pdev->dev, lynx_28g_xlate);
+	dev_set_drvdata(dev, priv);
+	provider = devm_of_phy_provider_register(dev, lynx_28g_xlate);
 
 	return PTR_ERR_OR_ZERO(provider);
 }
-- 
2.34.1