]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
phy: lynx-28g: use "dev" argument more in lynx_28g_probe()
authorVladimir Oltean <vladimir.oltean@nxp.com>
Tue, 25 Nov 2025 11:48:46 +0000 (13:48 +0200)
committerVinod Koul <vkoul@kernel.org>
Tue, 23 Dec 2025 17:41:06 +0000 (23:11 +0530)
We have "dev" which holds &pdev->dev, but we still dereference this
pointer 4 more times, instead of using the local variable.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Link: https://patch.msgid.link/20251125114847.804961-15-vladimir.oltean@nxp.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/phy/freescale/phy-fsl-lynx-28g.c

index be804f9b7d5eabbf2b07213cb76f2d323b135ea9..423223371dd09b4edd45b195fdf22a39f7614df3 100644 (file)
@@ -1160,10 +1160,10 @@ static int lynx_28g_probe(struct platform_device *pdev)
        struct device_node *dn;
        int err;
 
-       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))
@@ -1216,8 +1216,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);
 }