net: stmmac: replace the en_tx_lpi_clockgating field with a flag
authorBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Mon, 10 Jul 2023 09:00:01 +0000 (11:00 +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-13-brgl@bgdev.pl
Reviewed-by: Simon Horman <simon.horman@corigine.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
include/linux/stmmac.h

index 2d68a6e84b0e478633cac28a3a53aa8c06d78176..efe85b086abec68694c88dcbdd7f3c35e5c8e0a3 100644 (file)
@@ -421,7 +421,7 @@ static int stmmac_enable_eee_mode(struct stmmac_priv *priv)
        /* Check and enter in LPI mode */
        if (!priv->tx_path_in_lpi_mode)
                stmmac_set_eee_mode(priv, priv->hw,
-                               priv->plat->en_tx_lpi_clockgating);
+                       priv->plat->flags & STMMAC_FLAG_EN_TX_LPI_CLOCKGATING);
        return 0;
 }
 
index f51522cb0061145804c3f5354a5af74fcf036379..23d53ea04b24d3538f4f175d137e0c7fe5798486 100644 (file)
@@ -466,8 +466,8 @@ stmmac_probe_config_dt(struct platform_device *pdev, u8 *mac)
        plat->force_sf_dma_mode =
                of_property_read_bool(np, "snps,force_sf_dma_mode");
 
-       plat->en_tx_lpi_clockgating =
-               of_property_read_bool(np, "snps,en-tx-lpi-clockgating");
+       if (of_property_read_bool(np, "snps,en-tx-lpi-clockgating"))
+               plat->flags |= STMMAC_FLAG_EN_TX_LPI_CLOCKGATING;
 
        /* Set the maxmtu to a default of JUMBO_LEN in case the
         * parameter is not present in the device tree.
index c3769dad82381825aec0fa5c44b4cb7b9f034d19..ef67dba775d04a9d8361395a22b53a632a3c0f5a 100644 (file)
@@ -215,6 +215,7 @@ struct dwmac4_addrs {
 #define STMMAC_FLAG_EXT_SNAPSHOT_EN            BIT(8)
 #define STMMAC_FLAG_INT_SNAPSHOT_EN            BIT(9)
 #define STMMAC_FLAG_RX_CLK_RUNS_IN_LPI         BIT(10)
+#define STMMAC_FLAG_EN_TX_LPI_CLOCKGATING      BIT(11)
 
 struct plat_stmmacenet_data {
        int bus_id;
@@ -280,7 +281,6 @@ struct plat_stmmacenet_data {
        int has_gmac4;
        int rss_en;
        int mac_port_sel_speed;
-       bool en_tx_lpi_clockgating;
        int has_xgmac;
        u8 vlan_fail_q;
        unsigned int eee_usecs_rate;