]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
net: stmmac: dwc-qos: name struct plat_stmmacenet_data consistently
authorRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
Mon, 24 Feb 2025 16:53:10 +0000 (16:53 +0000)
committerJakub Kicinski <kuba@kernel.org>
Wed, 26 Feb 2025 02:17:53 +0000 (18:17 -0800)
Most of the stmmac driver uses "plat_dat" to name the platform data,
and "data" is used for the glue driver data. make dwc-qos follow
this pattern to avoid silly mistakes.

Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Tested-by: Thierry Reding <treding@nvidia.com>
Link: https://patch.msgid.link/E1tmbhe-004vSt-M3@rmk-PC.armlinux.org.uk
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/stmicro/stmmac/dwmac-dwc-qos-eth.c

index 392574bdd4a478e2035bb5f290973b8d6afb5f58..acb0a2e1664f94c6d83ef1864154ef26e58fefe0 100644 (file)
@@ -224,7 +224,7 @@ static int tegra_eqos_init(struct platform_device *pdev, void *priv)
 }
 
 static int tegra_eqos_probe(struct platform_device *pdev,
-                           struct plat_stmmacenet_data *data,
+                           struct plat_stmmacenet_data *plat_dat,
                            struct stmmac_resources *res)
 {
        struct device *dev = &pdev->dev;
@@ -241,12 +241,12 @@ static int tegra_eqos_probe(struct platform_device *pdev,
        if (!is_of_node(dev->fwnode))
                goto bypass_clk_reset_gpio;
 
-       for (int i = 0; i < data->num_clks; i++) {
-               if (strcmp(data->clks[i].id, "slave_bus") == 0) {
-                       eqos->clk_slave = data->clks[i].clk;
-                       data->stmmac_clk = eqos->clk_slave;
-               } else if (strcmp(data->clks[i].id, "tx") == 0) {
-                       eqos->clk_tx = data->clks[i].clk;
+       for (int i = 0; i < plat_dat->num_clks; i++) {
+               if (strcmp(plat_dat->clks[i].id, "slave_bus") == 0) {
+                       eqos->clk_slave = plat_dat->clks[i].clk;
+                       plat_dat->stmmac_clk = eqos->clk_slave;
+               } else if (strcmp(plat_dat->clks[i].id, "tx") == 0) {
+                       eqos->clk_tx = plat_dat->clks[i].clk;
                }
        }
 
@@ -260,7 +260,7 @@ static int tegra_eqos_probe(struct platform_device *pdev,
        gpiod_set_value(eqos->reset, 0);
 
        /* MDIO bus was already reset just above */
-       data->mdio_bus_data->needs_reset = false;
+       plat_dat->mdio_bus_data->needs_reset = false;
 
        eqos->rst = devm_reset_control_get(&pdev->dev, "eqos");
        if (IS_ERR(eqos->rst)) {
@@ -281,10 +281,10 @@ static int tegra_eqos_probe(struct platform_device *pdev,
        usleep_range(2000, 4000);
 
 bypass_clk_reset_gpio:
-       data->fix_mac_speed = tegra_eqos_fix_speed;
-       data->init = tegra_eqos_init;
-       data->bsp_priv = eqos;
-       data->flags |= STMMAC_FLAG_SPH_DISABLE;
+       plat_dat->fix_mac_speed = tegra_eqos_fix_speed;
+       plat_dat->init = tegra_eqos_init;
+       plat_dat->bsp_priv = eqos;
+       plat_dat->flags |= STMMAC_FLAG_SPH_DISABLE;
 
        err = tegra_eqos_init(pdev, eqos);
        if (err < 0)
@@ -309,7 +309,7 @@ static void tegra_eqos_remove(struct platform_device *pdev)
 
 struct dwc_eth_dwmac_data {
        int (*probe)(struct platform_device *pdev,
-                    struct plat_stmmacenet_data *data,
+                    struct plat_stmmacenet_data *plat_dat,
                     struct stmmac_resources *res);
        void (*remove)(struct platform_device *pdev);
 };
@@ -387,15 +387,15 @@ remove:
 static void dwc_eth_dwmac_remove(struct platform_device *pdev)
 {
        const struct dwc_eth_dwmac_data *data = device_get_match_data(&pdev->dev);
-       struct plat_stmmacenet_data *plat_data = dev_get_platdata(&pdev->dev);
+       struct plat_stmmacenet_data *plat_dat = dev_get_platdata(&pdev->dev);
 
        stmmac_dvr_remove(&pdev->dev);
 
        if (data->remove)
                data->remove(pdev);
 
-       if (plat_data)
-               clk_bulk_disable_unprepare(plat_data->num_clks, plat_data->clks);
+       if (plat_dat)
+               clk_bulk_disable_unprepare(plat_dat->num_clks, plat_dat->clks);
 }
 
 static const struct of_device_id dwc_eth_dwmac_match[] = {