net: stmmac: replace the sph_disable field with a flag
authorBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Mon, 10 Jul 2023 08:59:51 +0000 (10:59 +0200)
committerJakub Kicinski <kuba@kernel.org>
Fri, 14 Jul 2023 03:57:14 +0000 (20:57 -0700)
Drop the boolean field of the plat_stmmacenet_data structure in favor of a
simple bitfield flag.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Reviewed-by: Andrew Halaney <ahalaney@redhat.com>
Link: https://lore.kernel.org/r/20230710090001.303225-3-brgl@bgdev.pl
Reviewed-by: Simon Horman <simon.horman@corigine.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/stmicro/stmmac/dwmac-dwc-qos-eth.c
drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
include/linux/stmmac.h

index 9f88530..0c12ab6 100644 (file)
@@ -359,7 +359,7 @@ bypass_clk_reset_gpio:
        data->fix_mac_speed = tegra_eqos_fix_speed;
        data->init = tegra_eqos_init;
        data->bsp_priv = eqos;
-       data->sph_disable = 1;
+       data->flags |= STMMAC_FLAG_SPH_DISABLE;
 
        err = tegra_eqos_init(pdev, eqos);
        if (err < 0)
index ab9f876..ae5db39 100644 (file)
@@ -459,7 +459,7 @@ static int intel_mgbe_common_data(struct pci_dev *pdev,
        plat->has_gmac4 = 1;
        plat->force_sf_dma_mode = 0;
        plat->tso_en = 1;
-       plat->sph_disable = 1;
+       plat->flags |= STMMAC_FLAG_SPH_DISABLE;
 
        /* Multiplying factor to the clk_eee_i clock time
         * period to make it closer to 100 ns. This value
index 38b6cbd..18e5629 100644 (file)
@@ -7258,7 +7258,8 @@ int stmmac_dvr_probe(struct device *device,
                dev_info(priv->device, "TSO feature enabled\n");
        }
 
-       if (priv->dma_cap.sphen && !priv->plat->sph_disable) {
+       if (priv->dma_cap.sphen &&
+           !(priv->plat->flags & STMMAC_FLAG_SPH_DISABLE)) {
                ndev->hw_features |= NETIF_F_GRO;
                priv->sph_cap = true;
                priv->sph = priv->sph_cap;
index 8e75110..1b02f86 100644 (file)
@@ -205,6 +205,7 @@ struct dwmac4_addrs {
 };
 
 #define STMMAC_FLAG_HAS_INTEGRATED_PCS         BIT(0)
+#define STMMAC_FLAG_SPH_DISABLE                        BIT(1)
 
 struct plat_stmmacenet_data {
        int bus_id;
@@ -292,7 +293,6 @@ struct plat_stmmacenet_data {
        int msi_rx_base_vec;
        int msi_tx_base_vec;
        bool use_phy_wol;
-       bool sph_disable;
        bool serdes_up_after_phy_linkup;
        const struct dwmac4_addrs *dwmac4_addrs;
        unsigned int flags;